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

Fix assumption of "localStorage" presence when persisting request state #374

Open
Hypermona opened this issue Jun 25, 2021 · 9 comments
Open
Labels
Bug Something isn't working Good first issue Ideal for new contributors

Comments

@Hypermona
Copy link

About

Devtools does not detect a running instance of urql.

Reproduction

  1. Clone this example project
  2. Run yarn install
  3. Run yarn start
  4. Open chrome and navigate to http://localhost:8080
  5. Open the urql devtools panel

Expected result

  • Extension detects app

Actual result

  • Extension shows message "Waiting for exchange"

Stack trace

Error: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
  at la (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:6:58506)
  at Qo (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1043871)
  at ws (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1089921)
  at yu (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1082663)
  at mu (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1082588)
  at su (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1079618)
  at chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1031259
  at t.unstable_runWithPriority (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1106315)
  at Gi (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1030968)
  at Ji (chrome-extension://mcfphkbpmkbeofnkjehahlmidmceblmm/panel.js:2:1031204)

Additional info

environment version
browser Chrome 69
urql 0.0.0
urql devtools 0.0.0
@urql/devtools 0.0.0
@andyrichardson
Copy link
Collaborator

Hey there, thanks for the report!

Looks like this issue is caused by #350.

@ValGeorgiev was local storage working for you in the browser extension?

@frederikhors
Copy link

Is there a work-around?

@andyrichardson
Copy link
Collaborator

HI @frederikhors, for now there isn't - I just tried to reproduce the issue but haven't had any luck.

I'm guessing this is related to the browser being used - would be great if yourself or @Hypermona can share what browser and version you're experiencing this on.

@frederikhors
Copy link

frederikhors commented Aug 30, 2021

Chrome 92 Windows 10.

@raduflp
Copy link

raduflp commented Sep 13, 2021

It can be reproduced in Chrome 93, but only in Incognito Mode.
Tried disabling "Privacy Sandbox" but to no avail.

@frederikhors
Copy link

@andyrichardson Is anyone expected to work on it?

@pantajoe
Copy link

Had the same issue.
After deactivating "Block third-party cookies", the extension works (I believe you can also add an exception for localhost instead of disabling this option for all sites). Tested on MacOS and Chrome 99:
image

@andyrichardson
Copy link
Collaborator

Hey folks, sounds like this is due to having third party cookies blocked as @pantajoe has discovered - enabling them for the time being should get around the issue.

I'll leave this open as this can likely be resolved by introducing a check to see whether localStorage is available (see here) before storing cross-session state.

@andyrichardson andyrichardson changed the title [Runtime error]: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. Fix assumption of "localStorage" presence when persisting request state Aug 1, 2022
@peter-olom
Copy link

Will this ever be fixed? This issue appears stale and still a problem in 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Good first issue Ideal for new contributors
Projects
None yet
Development

No branches or pull requests

6 participants