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.

Failed to fetch dynamically imported module: GlobalScrollAreaStyles, OverlayScrollbars, WithTooltip

See original GitHub issue

I’m trying to upgrade Storybook to the latest version 6.2.8

Had multiple issues upgrading through yarn upgrade so the final solution was to remove all old packages and run npx -p @storybook/cli@ sb init. We discarded our old configuration (Storybook hasn’t been modified too much prior to this upgrade) and now we’re using the default config which came with the install, just used custom logic to load all of the stories still relying on the storiesOf api.

main.js


const path = require("path")

const toPath = (_path) => path.join(process.cwd(), _path)

module.exports = {
  "stories": [
    "./load-stories.js",

  ],
  "addons": [
    "@storybook/addon-links",
    {
      name: '@storybook/addon-essentials',
      options: {
        docs: false,
      }
    }
  ],
  // https://github.com/storybookjs/storybook/issues/13277
  webpackFinal: async (config) => {
    return {
      ...config,
      resolve: {
        ...config.resolve,
        alias: {
          ...config.resolve.alias,
          "@emotion/styled": toPath("node_modules/@emotion/styled"),
          "@emotion/provider": toPath("node_modules/@emotion/provider"),
          "@emotion/core": toPath("node_modules/@emotion/react"),
          "emotion-theming": toPath("node_modules/@emotion/react"),
          "babel-plugin-emotion": toPath("node_modules/@emotion/babel-plugin"),
        }
      }
    };
  }
}

The issue is that in 2 out of 3 runs, Storybook ui will throw an error in the browser:

Screenshot 2021-04-22 at 15 13 48

The error persists until I reinstall the storybook packages. The first run goes well, then if I restart the server it usually fails with the aforementioned error.

@babel/core”: “^7.13.15”, @storybook/addon-actions: ^6.2.8 => 6.2.8 @storybook/addon-essentials: ^6.2.8 => 6.2.8 @storybook/addon-links: ^6.2.8 => 6.2.8 @storybook/react: ^6.2.8 => 6.2.8 “react”: “^16.9.0” => 16.9.0 “react-dom”: “^16.9.0” => 16.9.0 “typescript”: “^3.5.3” => 3.8.3 “webpack”: “^4.17.1” => 4.46.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:8
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
timgoellercommented, Jun 8, 2021

@zakkor I was able to work around this by

  1. removing the acorn resolution
  2. then calling rm -rf node_modules && yarn
  3. then adding the acorn resolution again
  4. then calling yarn install

While this is definitely not a future-proof way to handle this, it allows you to at least run storybook in the meantime.

Edit: This seems to work only in some cases though. Meh.

3reactions
jsheelycommented, May 2, 2022

I am currently experiencing this issue. Switching to webpack5 comes with a whole lot of extra baggage with the pollyfill situation with stream and other node packages.

What is the trigger for this? I pulled one of my packages out of a mono repo and this started to become an issue. Is it a specific version of Storybook?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to fetch dynamically imported module - Issuehunt
Failed to fetch dynamically imported module : GlobalScrollAreaStyles, OverlayScrollbars, WithTooltip #14694 ... Had multiple issues upgrading through yarn upgrade ...
Read more >
Failed to fetch dynamically imported module: - Stack Overflow
Often, the following error happens in production. Failed to fetch dynamically imported module: It has happened in all routes. https://help.
Read more >
failed to fetch dynamically imported module storybook vite
We have a vanilla Vue/Vite setup and I'm receiving TypeError: Failed to fetch dynamically imported module on sentry logs. It seems like the...
Read more >
Failed to fetch dynamically imported module : r/sveltejs - Reddit
Here's a startup project that has SSR with user data from Firebase: https://github.com/ManuelDeLeon/sveltekit-firebase-ssr It works as ...
Read more >
Npm storybook angular
WebWeb portage county wi fatal car crash Failed to fetch dynamically imported module : GlobalScrollAreaStyles, OverlayScrollbars, WithTooltip #14694 pdimova ...
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