Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next fails in safari iframe #3118

Closed
philipheinser opened this issue Oct 17, 2017 · 5 comments
Closed

next fails in safari iframe #3118

philipheinser opened this issue Oct 17, 2017 · 5 comments

Comments

@philipheinser
Copy link

next version: 4.1.0

When we load our nextjs app in an iframe we get an error at the following line and our component doesn't respond to input.

replaceState@[native code] changeState@http://localhost:8081/_next/1508243766275/main.js:8667:33 Router@http://localhost:8081/_next/1508243766275/main.js:8298:23 Router@[native code] createRouter@http://localhost:8081/_next/1508243766275/main.js:1055:102 _callee$@http://localhost:8081/_next/1508243766275/main.js:18220:63 tryCatch@http://localhost:8081/_next/1508243766275/main.js:7005:44 invoke@http://localhost:8081/_next/1508243766275/main.js:7239:30 step@http://localhost:8081/_next/1508243766275/main.js:1823:30 http://localhost:8081/_next/1508243766275/main.js:1834:17 promiseReactionJob@[native code]

https://github.com/zeit/next.js/blob/c6bd6ef9973b935df116eaafec1cd57555aa1b93/lib/router/router.js#L188

@tomsoderlund
Copy link

I’m getting a similar error in Chrome/Firefox when I run my Next.js app inside an IFrame (works great outside the IFrame):

Failed to execute 'replaceState' on 'History': A history state object with URL 'http://localhost:3000/' cannot be created in a document with origin 'http://localhost:8000' and URL 'http://localhost:8000/'.
Error: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://localhost:3000/' cannot be created in a document with origin 'http://localhost:8000' and URL 'http://localhost:8000/'

From what I can tell, it’s this line that’s crashing:

https://github.com/zeit/next.js/blob/master/lib/router/router.js#L188

@philipheinser is this similar to your issue?

Any clues on how to solve?

@timneutkens
Copy link
Member

This has been fixed in Next 5+ if i remember correctly.

@tomsoderlund
Copy link

I’m seeing this issue still in Next.js 7.0.2, wasn’t this patched in #3437?

@tomsoderlund
Copy link

@timneutkens, do you know if #3437 was patched in?

@tomsoderlund
Copy link

Failed to execute 'replaceState' on 'History': A history state object with URL 'https://MYSERVER1/page' cannot be created in a document with origin 'https://MYSERVER2.com' and URL 'https://MYSERVER2.com/page'.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants