JavaScript (ES6), 81 bytes
f=
s=>s.replace(/(?=(.+)\1)/g,(_,m)=>(n=m.length)>l&&(l=n,r=m),l=0)&&s.replace(r,'')
<input oninput=o.textContent=f(this.value,r='')><pre id=o>
The ,r=''
prevents the function crashing on invalid input.
f=
s=>s.replace(/(?=(.+)\1)/g,(_,m)=>(n=m.length)>l&&(l=n,r=m),l=0)&&s.replace(r,'')
<input oninput=o.textContent=f(this.value,r='')><pre id=o>
The ,r=''
prevents the function crashing on invalid input.