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.

Javascript doesn't work when Next JS runs inside iframe in Storyblok CMS

See original GitHub issue

Bug report

Describe the bug

When I run my site (Next JS 9.4.4) inside the Storyblok content editor (which places it inside an iframe) then no Javascript is run on the site and as such the screen stays blank because of a fix added to a recent Next release to hide the FOUC.

I think javascript execution stops because of the following error:

Error was not caught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
    at initializeBuildWatcher (http://localhost:3000/_next/static/runtime/main.js?ts=1591116741992:11757:38)
    at http://localhost:3000/_next/static/runtime/main.js?ts=1591116741992:13020:40
(anonymous) @ next-dev.js:48
Promise.catch (async)
(anonymous) @ next-dev.js:30
./node_modules/next/dist/client/next-dev.js @ next-dev.js:30
__webpack_require__ @ bootstrap:797
checkDeferredModules @ bootstrap:44
webpackJsonpCallback @ bootstrap:31
(anonymous) @ main.js?ts=1591116741992:1

To Reproduce

It is not possible to reproduce the problem without logging into a private Storyblok account to see it.

System information

  • OS: [Windows]
  • Browser [chrome]
  • Version of Next.js: [9.4.4]

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dohomicommented, Jan 20, 2022

I use Next/Storyblok and the issue is no longer present. I think the issue can be safely closed.

1reaction
dohomicommented, Jun 11, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a headless CMS to Next.js in 5 minutes - Storyblok
In this short tutorial, we will explore how to integrate Storyblok into a Next.js application, and enable the live preview in the Visual...
Read more >
Next.js Preview in iframes - Storyblok
This FAQ shows a potential solution while integrating NextJs' Preview Mode https://nextjs.org/docs/advanced-features/preview-mode within an iframe while ...
Read more >
How to use storyblok-latest.js
This script will communicate via iframe with Storyblok to tell the editing interface which component needs to be opened when the user clicks...
Read more >
FAQs - Storyblok
How can I open my custom field type in full screen? Each custom field type is sandboxed in an iframe. To still allow...
Read more >
How to Build a Storefront with Next.js and BigCommerce
If you open the Home Page in Storyblok, you will see a page not found error. Since Storyblok automatically creates a /home path...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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