question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stackblitz preview doesn't work on Chrome

See original GitHub issue

Live reload/ preview doesn’t work in Chrome (Version 61.0.3163.100 (Official Build) (64-bit)).

Steps to reproduce:

  1. create a new project (ex: https://stackblitz.com/edit/angular-ta3yfy)
  2. the preview section doesn’t load (open in a new window works, but without live reload)
_relay_:10 Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
    at https://angular-vxbayq.stackblitz.io/_relay_:10:7
    at https://angular-vxbayq.stackblitz.io/_relay_:43:7
(anonymous) @ _relay_:10
(anonymous) @ _relay_:43
preview-7160e757d494cd480578.js:1 Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
    at Object.255 (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:104517)
    at t (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:101)
    at Object.1003 (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:4791)
    at t (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:101)
    at Object.254 (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:103669)
    at t (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:101)
    at Object.439 (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:116545)
    at t (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:101)
    at Object.447 (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:117808)
    at t (https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js:1:101)
255 @ preview-7160e757d494cd480578.js:1
t @ preview-7160e757d494cd480578.js:1
1003 @ preview-7160e757d494cd480578.js:1
t @ preview-7160e757d494cd480578.js:1
254 @ preview-7160e757d494cd480578.js:1
t @ preview-7160e757d494cd480578.js:1
439 @ preview-7160e757d494cd480578.js:1
t @ preview-7160e757d494cd480578.js:1
447 @ preview-7160e757d494cd480578.js:1
t @ preview-7160e757d494cd480578.js:1
n.10 @ preview-7160e757d494cd480578.js:1
(anonymous) @ preview-7160e757d494cd480578.js:1
(index):11 Uncaught ReferenceError: _preboot is not defined
    at (index):11
    at (index):11

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:24
  • Comments:33 (1 by maintainers)

github_iconTop GitHub Comments

266reactions
cvietorcommented, Jan 15, 2018

thx @danmana a quick workaround without enabling 3rd party cookies globally is to add an exception to stackblitz.io

-> chrome://settings/content/cookies -> Allow -> Add: [*.]stackblitz.io

28reactions
danmanacommented, Oct 9, 2017

@EricSimons Same in incognito mode without extensions.

I found the issue: aparently having the following setting enabled blocks both cookies and local storage

chrome://settings/content/cookies

Block third-party cookies
Prevent third-party websites from saving and reading cookie data

The js file in question is served from https://angular-ta3yfy.stackblitz.io The main window is loaded from https://stackblitz.com/edit/angular-ta3yfy Since these are two different domains, Chrome blocks cookies and local storage access.

Same happens when the originating call comes from: https://static.stackblitz.com/assets/packs/preview-7160e757d494cd480578.js

I’m not sure how this should be addressed, or even if it’s possible while keeping each project sandboxed. Perhaps the window url should also be on the project domain? (ex: https://angular-ta3yfy.stackblitz.io/edit)

Right now the only alternative is running with 3rd party cookies enabled, which some users might not want to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebContainers Browser Support - StackBlitz Docs
WebContainers are fully supported in Chrome and most Chromium-based browsers including Brave, Edge, Vivaldi, and others. However, if you enabled blocking third- ...
Read more >
Why is embedded Stackblitz project unable to display preview ...
There was a bug in stackblitz which caused this error while embedding static html/css/js projects. But the bug was fixed recently by the ......
Read more >
"View on StackBlitz" not working for some sample applications ...
Hi,. The following link does not work for me in StackBlitz: Demo grid-pager-sample. Also other demos don't work for me in Google Chrome....
Read more >
1711698 - Stackblitz does not work - Bugzilla@Mozilla
In your case, Stackblitz doesn't work because the 'network.cookie.lifetimePolicy' has been set to 2 (Session Cookie only). This would change several things, ...
Read more >
stackblitz.com doesn't work - Vivaldi Forum
But I have not disabled third-party cookies (The settings are the same in Google Chrome, where it works). Is this related to Vivaldi...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found