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

DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL #24

Open
harsimerkaur opened this issue Jul 29, 2020 · 1 comment
Labels
investigation This issue needs an investigation

Comments

@harsimerkaur
Copy link

Issue Title

web page does not open when viewed in google cached option.

Expected Behavior

Should work in a similar way in google web cache as working when directly opened.

Current Behavior

After implementing SSR as described in the documentation, app works fine, but when viewed with google cached option I get:

vendor.72c7865b.chunk.js:2 DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'https://mywebsite.com/' cannot be created in a document with origin 'http://webcache.googleusercontent.com' and URL 'http://webcache.googleusercontent.com/search?q=cache:X4dz2ukZZAYJ:https://mywebsite.com/&hl=en&gl=in&strip=0&vwsrc=0'.
at History.b. [as replaceState] (https://connect.facebook.net/en_US/fbevents.js:25:31098)
at https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:23763
at Object.confirmTransitionTo (https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:21254)
at Object.replace (https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:23671)
at render (https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/rootcomp.1fc87201.chunk.js:1:1466)
at https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:4947
at vu (https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:142881)
at cl (https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:132015)
at ul (https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:131940)
at Zu (https://ssr-static.mywebsite.com/v19.7.7-1810-gab2a29c95/static/vendor.72c7865b.chunk.js:2:128970)

Possible Solution

Is this related to CORS? because when I open web app in google chrome with disabled security then it opens the webpage correctly with cached option.

Steps to Reproduce

Search react router in google chrome, open cached option, check console.
It shows same error.
Screen Shot 2020-07-29 at 1 54 56 AM

Context (Environment)

react-loadable-ssr-addon: "0.2.0"
history: "^4.10.1",
react-router-dom: "^5.1.2"

Environment

  1. OS running:
  2. Node version:
  3. Webpack version:

Detailed Description

Possible Implementation

Other Comments

This issue might be related Failed to execute 'replaceState' on 'History'

@themgoncalves themgoncalves added the investigation This issue needs an investigation label Aug 4, 2020
@themgoncalves
Copy link
Owner

Hi @harsimerkaur, thanks for reporting, I will be investigating this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation This issue needs an investigation
Projects
None yet
Development

No branches or pull requests

2 participants