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

GET http://localhost:6006/sb-preview/runtime.js net::ERR_ABORTED 404 (Not Found) #30335

Open
lovelyJason opened this issue Jan 22, 2025 · 33 comments

Comments

@lovelyJason
Copy link

lovelyJason commented Jan 22, 2025

Describe the bug

select vue3 and vite
then run pnpm storybook

The command line reported an error:

  info => Starting manager..
  info => Starting preview..
  The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
  ╭────────────────────────────────────────────────────────────────────────────────────────────────╮
  │                                                                                                │
  │   Storybook 8.5.0 for D:\projects\nominox\gamebff-frontend\node_modules\.pnpm\@storybook+vue   │
  │   [email protected][email protected][email protected][email protected]_@[email protected]_less_ih2kvum5g4   │
  │   cpenog3bonzyb23e\node_modules\@storybook\vue3-vite started                                   │
  │   681 ms for manager and 5.29 s for preview                                                    │
  │                                                                                                │
  │   Local:            http://localhost:6006/                                                     │
  │   On your network:  http://192.168.169.77:6006/                                                │
  │                                                                                                │
  ╰────────────────────────────────────────────────────────────────────────────────────────────────╯X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "WithTooltip"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:9:
        3 │ import { WithTooltip, TooltipNote, Form } from 'storybook/internal/components';
          ╵          ~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "TooltipNote"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:22:
        3 │ import { WithTooltip, TooltipNote, Form } from 'storybook/internal/components';
          ╵                       ~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Form"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:35:
        3 │ import { WithTooltip, TooltipNote, Form } from 'storybook/internal/components';
          ╵                                    ~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "withReset"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:9:
        4 │ import { withReset, SyntaxHighlighter, FlexBar, Form, IconButton, codeCommon, compon...
          ╵          ~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "SyntaxHighlighter"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:20:
        4 │ import { withReset, SyntaxHighlighter, FlexBar, Form, IconButton, codeCommon, compon...
          ╵                     ~~~~~~~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "FlexBar"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:39:
        4 │ import { withReset, SyntaxHighlighter, FlexBar, Form, IconButton, codeCommon, compon...
          ╵                                        ~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Form"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:48:
        4 │ ...withReset, SyntaxHighlighter, FlexBar, Form, IconButton, codeCommon, components, ...
          ╵                                           ~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "IconButton"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:54:
        4 │ ..., SyntaxHighlighter, FlexBar, Form, IconButton, codeCommon, components, Zoom, Act...
          ╵                                        ~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "codeCommon"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:66:
        4 │ ...lighter, FlexBar, Form, IconButton, codeCommon, components, Zoom, ActionBar, Butt...
          ╵                                        ~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "components"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:78:
        4 │ ...xBar, Form, IconButton, codeCommon, components, Zoom, ActionBar, Button, Link, Re...
          ╵                                        ~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Zoom"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:90:
        4 │ ...m, IconButton, codeCommon, components, Zoom, ActionBar, Button, Link, ResetWrappe...
          ╵                                           ~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "ActionBar"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:96:
        4 │ ...tton, codeCommon, components, Zoom, ActionBar, Button, Link, ResetWrapper, Code, ...
          ╵                                        ~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Button"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:107:
        4 │ ...eCommon, components, Zoom, ActionBar, Button, Link, ResetWrapper, Code, nameSpace...
          ╵                                          ~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Link"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:115:
        4 │ ..., components, Zoom, ActionBar, Button, Link, ResetWrapper, Code, nameSpaceClassNa...
          ╵                                           ~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "ResetWrapper"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:121:
        4 │ ...ts, Zoom, ActionBar, Button, Link, ResetWrapper, Code, nameSpaceClassNames, H3, H...
          ╵                                       ~~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Code"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:135:
        4 │ ...ActionBar, Button, Link, ResetWrapper, Code, nameSpaceClassNames, H3, H2, Loader,...
          ╵                                           ~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "nameSpaceClassNames"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:141:
        4 │ ...ton, Link, ResetWrapper, Code, nameSpaceClassNames, H3, H2, Loader, EmptyTabConte...
          ╵                                   ~~~~~~~~~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "H3"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:162:
        4 │ ...esetWrapper, Code, nameSpaceClassNames, H3, H2, Loader, EmptyTabContent, TabsStat...
          ╵                                            ~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "H2"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:166:
        4 │ ...Wrapper, Code, nameSpaceClassNames, H3, H2, Loader, EmptyTabContent, TabsState, E...
          ╵                                            ~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Loader"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:170:
        4 │ ...r, Code, nameSpaceClassNames, H3, H2, Loader, EmptyTabContent, TabsState, ErrorFo...
          ╵                                          ~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "EmptyTabContent"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:178:
        4 │ ...SpaceClassNames, H3, H2, Loader, EmptyTabContent, TabsState, ErrorFormatter, getS...
          ╵                                     ~~~~~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "TabsState"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:195:
        4 │ ...s, H3, H2, Loader, EmptyTabContent, TabsState, ErrorFormatter, getStoryHref, With...
          ╵                                        ~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "ErrorFormatter"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:206:
        4 │ ...ader, EmptyTabContent, TabsState, ErrorFormatter, getStoryHref, WithTooltipPure }...
          ╵                                      ~~~~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "getStoryHref"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:222:
        4 │ ...ontent, TabsState, ErrorFormatter, getStoryHref, WithTooltipPure } from 'storyboo...
          ╵                                       ~~~~~~~~~~~~
  
  X [ERROR] No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "WithTooltipPure"
  
      ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:236:
        4 │ ...e, ErrorFormatter, getStoryHref, WithTooltipPure } from 'storybook/internal/compo...
          ╵                                     ~~~~~~~~~~~~~~~
  
  
   ERROR  Unhandled promise rejection: Build failed with 25 errors:                       17:16:52
  ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:9: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "WithTooltip"
  ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:22: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "TooltipNote"
  ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:35: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Form"
  ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:9: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "withReset"
  ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:20: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "SyntaxHighlighter"
  ...
  
    ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:9: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "WithTooltip"
    ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:22: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "TooltipNote"
    ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/Color-F6OSRLHC.mjs:3:35: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "Form"
    ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:9: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "withReset"
    ../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/@storybook/blocks/dist/index.mjs:4:20: ERROR: No matching export in "../../node_modules/.pnpm/[email protected][email protected]/node_modules/storybook/core/components/index.js" for import "SyntaxHighlighter"
    ...
    at failureErrorWithLog (D:\projects\nominox\gamebff-frontend\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1472:15)
    at D:\projects\nominox\gamebff-frontend\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:945:25
    at D:\projects\nominox\gamebff-frontend\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1353:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

and on the page for http://localhost:6006/, error:

GET http://localhost:6006/sb-preview/runtime.js net::ERR_ABORTED 404 (Not Found)

Image

There are problems with almost all of your versions

Reproduction link

no

Reproduction steps

No response

System

System:
    OS: Windows 10 10.0.19045
    CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700
  Binaries:
    Node: 20.14.0 - ~\AppData\Local\fnm_multishells\23504_1737369058038\node.EXE
    npm: 10.7.0 - ~\AppData\Local\fnm_multishells\23504_1737369058038\npm.CMD
    pnpm: 9.12.2 - ~\AppData\Local\fnm_multishells\23504_1737369058038\pnpm.CMD <----- active
  Browsers:
    Edge: Chromium (128.0.2739.63)
  npmPackages:
    @storybook/addon-essentials: 8.5.0 => 8.5.0
    @storybook/addon-interactions: 8.5.0 => 8.5.0
    @storybook/addon-onboarding: 8.5.0 => 8.5.0
    @storybook/blocks: 8.5.0 => 8.5.0
    @storybook/test: 8.5.0 => 8.5.0
    @storybook/vue3: 8.5.0 => 8.5.0
    @storybook/vue3-vite: 8.5.0 => 8.5.0
    storybook: 8.5.0 => 8.5.0

Additional context

No response

Copy link
Contributor

greptile-apps bot commented Jan 22, 2025

** Disclaimer** This information might be inaccurate, due to it being generated automatically
This appears to be an issue with missing exports from the storybook/internal/components package. The error occurs because the Vue3 Vite builder is trying to import components that don't exist at the expected path.

To fix this:

  1. Update your imports to use the correct paths:
    js import { WithTooltip, TooltipNote, Form } from '@storybook/components';

  2. Add the following to your .storybook/main.js:
    js module.exports = { framework: '@storybook/vue3-vite', core: { disableTelemetry: true }, viteFinal: async (config) => { config.resolve.alias = { ...config.resolve.alias, 'storybook/internal/components': '@storybook/components' }; return config; } };

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Edit Issue Bot Settings · Greptile

@shavonn
Copy link

shavonn commented Jan 24, 2025

Experiencing the same 404 error. However, I am using the @storybook/react-vite framework.

@coryphil
Copy link

Experiencing the same 404 error. However, I am using the @storybook/react-vite framework.

Same 404 error as well. I’ve filed a separate bug report for it since I’m not having the other non 404 issue in this bug.

@mdillgen
Copy link

Same error on @storybook/react-vite

@shilman
Copy link
Member

shilman commented Jan 26, 2025

@lovelyJason is on windows. @shavonn @coryphil @mdillgen are you all on windows too? i am unable to reproduce.

@mdillgen
Copy link

Hi @shilman , I am on MacOS.
I think it's only fair to provide an example repo here too. However, this only includes a fresh installation.
https://github.com/mdillgen/sb-test

@shilman
Copy link
Member

shilman commented Jan 27, 2025

@mdillgen Thanks so much. When I install this on my computer it runs fine:

pnpm i
pnpm run storybook

Can you please run npx storybook info and paste the results here? I'd like to understand what is different about your environment. Thanks for your help to track this down!

@mdillgen
Copy link

mdillgen commented Jan 27, 2025

Hi, @shilman . Thank YOU for investigating. First off all you are right, it runs with pnpm run storybook. Obviously my example repo has npx serve storybook-static -p 6006 as the start script set. This is where the initial screen can’t find the right preview! So pnpm run storybook does solve the issue at a first glance and the landing page “Configure your project” is shown. But, anyway the error persists in console (see attachment):

Image

Also during build it throws some warnings:

vite v6.0.11 building for production...
node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/preview/runtime.js (3212:15): Use of eval in "node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/preview/runtime.js" is strongly discouraged as it poses security risks and may cause issues with minification.
node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/preview/runtime.js (3214:16): Use of eval in "node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/preview/runtime.js" is strongly discouraged as it poses security risks and may cause issues with minification.
✓ 122 modules transformed.

Storybook Environment Info:

System:
OS: macOS 15.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: 9.15.4 - ~/Library/pnpm/pnpm <----- active
Browsers:
Chrome: 132.0.6834.111
Safari: 18.2
npmPackages:
@storybook/addon-essentials: ^8.5.1 => 8.5.1
@storybook/addon-interactions: ^8.5.1 => 8.5.1
@storybook/addon-onboarding: ^8.5.1 => 8.5.1
@storybook/blocks: ^8.5.1 => 8.5.1
@storybook/react: ^8.5.1 => 8.5.1
@storybook/react-vite: ^8.5.1 => 8.5.1
@storybook/test: ^8.5.1 => 8.5.1
eslint-plugin-storybook: ^0.11.2 => 0.11.2
storybook: ^8.5.1 => 8.5.1

I have updated the example repo to contain the right start script!

@shilman
Copy link
Member

shilman commented Jan 27, 2025

Great. I'll give it a shot when I get back to my computer!

@coryphil
Copy link

@shilman I am on MacOS. Using react-vite.

@shilman
Copy link
Member

shilman commented Jan 27, 2025

@coryphil also experiencing only in production mode like @mdillgen ? Or also in dev mode? What does npx storybook info output on your setup?

@coryphil
Copy link

@shilman I am experiencing it in both production and dev. Just the console errors for 404 on runtime and iframe and infinite spinner until I refresh the page.

Storybook Environment Info:

  System:
    OS: macOS 14.7
    CPU: (12) arm64 Apple M3 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.5.0 - /opt/homebrew/bin/node
    npm: 10.9.2 - /opt/homebrew/bin/npm <----- active
    pnpm: 9.12.1 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 129.0.6668.90
    Safari: 17.6
  npmPackages:
    @storybook/addon-a11y: 8.4.7 => 8.4.7 
    @storybook/addon-essentials: 8.4.7 => 8.4.7 
    @storybook/addon-interactions: 8.4.7 => 8.4.7 
    @storybook/addon-links: 8.4.7 => 8.4.7 
    @storybook/addon-onboarding: 8.4.7 => 8.4.7 
    @storybook/blocks: 8.4.7 => 8.4.7 
    @storybook/builder-vite: 8.4.7 => 8.4.7 
    @storybook/react: 8.4.7 => 8.4.7 
    @storybook/react-vite: 8.4.7 => 8.4.7 
    @storybook/test: 8.3.5 => 8.3.5 
    @storybook/test-runner: 0.19.1 => 0.19.1 
    chromatic: 11.10.4 => 11.10.4 
    storybook: 8.4.7 => 8.4.7 
    storybook-addon-tailwind-autodocs: 1.0.8 => 1.0.8 
    storybook-react-i18next: 3.1.7 => 3.1.7 

@shilman
Copy link
Member

shilman commented Jan 27, 2025

@coryphil do you have a repro you can share?

@maxime-louellette
Copy link

Same error here. The issue occured when I upgraded storybook from 8.5.0 to 8.5.1

Image
Image

I also updated to 8.5.2, but nothing changed.

Storybook Environment Info:

  System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
  Binaries:
    Node: 20.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.11.0 - ~\AppData\Roaming\npm\pnpm.CMD <----- active
  Browsers:
    Edge: Chromium (131.0.2903.112)
  npmPackages:
    @storybook/addon-essentials: ^8.5.2 => 8.5.2
    @storybook/addon-links: ^8.5.2 => 8.5.2
    @storybook/addon-themes: ^8.5.2 => 8.5.2
    @storybook/blocks: ^8.5.2 => 8.5.2
    @storybook/experimental-addon-test: ^8.5.2 => 8.5.2
    @storybook/react: ^8.5.2 => 8.5.2
    @storybook/react-vite: ^8.5.2 => 8.5.2
    @storybook/test: ^8.5.2 => 8.5.2
    storybook: ^8.5.2 => 8.5.2
    storybook-addon-pseudo-states: ^4.0.2 => 4.0.2

@MatheoJaouen
Copy link

see #30378 related?

@coryphil
Copy link

@MatheoJaouen Yes, they are related. I created that bug since my issue was only the 404 and not the additional things in this one. Sorry if there was any confusion.

@coryphil
Copy link

@shilman Unfortunately, I can not share my repo. As for reproduction steps I just install any storybook version post 8.3.7 and try to run pnpm storybook (I am using react-vite). There are no errors in terminal. Console has the previously stated 404s.

@shilman
Copy link
Member

shilman commented Jan 27, 2025

OK I'm reproducing now based on @mdillgen 's repo. Thanks everybody for your patience! Will try to track it down with the team. 🎉

@shilman
Copy link
Member

shilman commented Jan 27, 2025

Documenting the issue for the team, summarizing the above:

  1. In an empty directory, run npx storybook@latest init and pick the react-vite option
  2. Then run npm run build-storybook. It will warn:
vite v6.0.11 building for production...
node_modules/@storybook/core/dist/preview/runtime.js (3212:15): Use of eval in "node_modules/@storybook/core/dist/preview/runtime.js" is strongly discouraged as it poses security risks and may cause issues with minification.
node_modules/@storybook/core/dist/preview/runtime.js (3214:16): Use of eval in "node_modules/@storybook/core/dist/preview/runtime.js" is strongly discouraged as it poses security risks and may cause issues with minification.
✓ 122 modules transformed.
  1. If you look at the output index.html it contains the following line. However the file does not exist.
    <link href="./sb-preview/runtime.js" rel="prefetch" as="script" />

Digging in a little more, it looks like the file node_modules/@storybook/core/dist/preview/runtime.js DOES use eval and it's coming from the telejson package. This code is not used by default--you need to configure it to use a legacy setting--but the code is still prebundled in.

Some guesses:

  • This issue might have been introduced during the package reduction project by prebundling things.
  • It might have been around for awhile, but Vite 5 was OK with eval and only Vite 6 is bailing

At any rate, we should do something about it.

@victor9000
Copy link

victor9000 commented Feb 4, 2025

Just adding my affected versions to the discussion, errors show when everything is on the latest release 8.5.3

Command:

storybook build --docs

Results in:

docs:build: @storybook/core v8.5.3
docs:build: 
docs:build: info => Cleaning outputDir: storybook-static
docs:build: info => Loading presets
docs:build: info => Building manager..
docs:build: info => Manager built (130 ms)
docs:build: info => Building preview..
docs:build: info Using tsconfig paths for react-docgen
docs:build: vite v5.4.11 building for production...
../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/preview/runtime.js (3212:15): Use of eval in "../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/preview/runtime.js" is strongly discouraged as it poses security risks and may cause issues with minification.
../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/preview/runtime.js (3214:16): Use of eval in "../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/preview/runtime.js" is strongly discouraged as it poses security risks and may cause issues with minification.
✓ 2803 modules transformed.

Storybook Environment Info:

  System:
    OS: Linux 6.12 Fedora Linux 41 (Workstation Edition)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Shell: 5.2.32 - /bin/bash
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    pnpm: 9.14.2 - ~/.local/share/pnpm/pnpm <----- active
  Browsers:
    Chrome: 132.0.6834.83
  npmPackages:
    @storybook/addon-actions: 8.5.3 => 8.5.3 
    @storybook/addon-essentials: 8.5.3 => 8.5.3 
    @storybook/addon-links: 8.5.3 => 8.5.3 
    @storybook/react: 8.5.3 => 8.5.3 
    @storybook/react-vite: 8.5.3 => 8.5.3 
    storybook: 8.5.3 => 8.5.3 

@mateuszwrobel
Copy link

clean repo and updated packages:
https://github.com/mateuszwrobel/st-test

Storybook Environment Info:

  System:
    OS: Windows 11 10.0.26100
    CPU: (14) x64 Intel(R) Core(TM) Ultra 7 165U
  Binaries:
    Node: 23.3.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD <----- active
  Browsers:
    Edge: Chromium (131.0.2903.112)
  npmPackages:
    @storybook/addon-essentials: ^8.5.0 => 8.5.3
    @storybook/addon-onboarding: ^8.5.0 => 8.5.3
    @storybook/blocks: ^8.5.0 => 8.5.3
    @storybook/experimental-addon-test: ^8.5.0 => 8.5.3
    @storybook/react: ^8.5.0 => 8.5.3
    @storybook/react-vite: ^8.5.0 => 8.5.3
    @storybook/test: ^8.5.0 => 8.5.3
    storybook: ^8.5.0 => 8.5.3

error prevents us from running chromatic and it's a blocker, as configurations done in preview are not fired.

do we know when fix is expected to be done for this?

@elisehein
Copy link

elisehein commented Feb 5, 2025

I'm experiencing the same issue with Lit + Vite.

  1. pnpm dlx storybook@latest init, select Lit + Vite
  2. When it runs, you can see the 404 to runtime.js.
Storybook Environment Info:

  System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.asdf/installs/nodejs/18.17.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.7 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 8.9.2 - ~/Library/pnpm/pnpm <----- active
  Browsers:
    Chrome: 132.0.6834.160
    Safari: 18.2
  npmPackages:
    @storybook/addon-essentials: ^8.5.3 => 8.5.3 
    @storybook/blocks: ^8.5.3 => 8.5.3 
    @storybook/test: ^8.5.3 => 8.5.3 
    @storybook/web-components: ^8.5.3 => 8.5.3 
    @storybook/web-components-vite: ^8.5.3 => 8.5.3 
    storybook: ^8.5.3 => 8.5.3 

I tried downgrading to 8.5.0 but getting the same error. 8.4.7 works.

@mariohernandez
Copy link

mariohernandez commented Feb 8, 2025

I am also experiencing the same issue and although Storybook runs fine, when a story has custom JS that's when the error happens and the custom JS does not execute. Here are my environment details:

    OS: macOS 15.3
    CPU: (12) arm64 Apple M2 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.1 - ~/.nvm/versions/node/v20.12.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v20.12.1/bin/npm <----- active
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.3
  npmPackages:
    @storybook/addon-essentials: ^8.5.3 => 8.5.3 
    @storybook/addon-interactions: ^8.5.3 => 8.5.3 
    @storybook/addon-mdx-gfm: ^8.5.3 => 8.5.3 
    @storybook/blocks: ^8.5.3 => 8.5.3 
    @storybook/html: ^8.5.3 => 8.5.3 
    @storybook/html-vite: ^8.5.3 => 8.5.3 
    @storybook/manager-api: ^8.5.3 => 8.5.3 
    @storybook/test: ^8.5.3 => 8.5.3 
    @storybook/theming: ^8.5.3 => 8.5.3 
    storybook: ^8.5.3 => 8.5.3 ```

@trekinbami
Copy link

Exact same problem here with React + Vite. Development works fine. Static build errors out.

@shilman
Copy link
Member

shilman commented Feb 10, 2025

🚨 ATTENTION 🚨 Per my comment above, this is a real bug and we'll get to the bottom of it. However, as far as I can tell, it doesn't actually have a huge impact on anything. If you're having a problem with Storybook and believe that this error is the root cause, please let me know!

@coryphil
Copy link

@shilman this does seem to cause one issue. Since I have to manually refresh storybook to get it to actually load, when it goes through an automated build process, like say for chromatic, it causes a bunch of errors because it never loads as those don’t know to refresh the page once to account for the error. Also, thank you so much for the investigation of this bug.

@shilman
Copy link
Member

shilman commented Feb 10, 2025

@coryphil what problem do you have with chromatic? I had a teammate also report this bug in connection to the @chromatic/storybook addon but I tried to reproduce and everything worked OK for me in spite of this error.

@valentinpalkovic valentinpalkovic moved this from Needs Discussion to Empathy Backlog in Core Team Projects Feb 10, 2025
@trekinbami
Copy link

@shilman Due to this bug our static storybook build does not load. So our entire organisation is missing documentation. I'm absolutely not trying to push or anything, because you guys are going as hard as you can. Just stating that this bug does have a severe impact for us.

@shilman
Copy link
Member

shilman commented Feb 10, 2025

@trekinbami are you sure this bug is the problem? I'm asking because I'm seeing the bug but I'm not seeing any serious side effects of the bug. Do you have a reproduction you can share? Will absolutely fast track this if i have hard evidence it's breaking stuff.

@MidWestWorker
Copy link

MidWestWorker commented Feb 11, 2025

@trekinbami Yes, with this issue we getting Failed to fetch dynamically imported module,

:6006/sb-preview/runtime.js:1 Failed to load resource: the server responded with a status of 404 (Not Found). When this occurs all mapping breaks and cannot load any .ts

Windows environment as well.

@davidsteger8
Copy link

@trekinbami Yes, with this issue we getting Failed to fetch dynamically imported module,

:6006/sb-preview/runtime.js:1 Failed to load resource: the server responded with a status of 404 (Not Found). When this occurs all mapping breaks and cannot load any .ts

Windows environment as well.

I don't know if this is caused by runtime.js. However, I also get the mentioned error whenever a React component is passed a children prop.

I have created a very simple example here:
https://github.com/davidsteger8/storybook-react-no-children

@Ivlay
Copy link

Ivlay commented Feb 11, 2025

For a quick fix in production on CFPages (if you're using it), you can try this shell script.
This is because CFPages attempts to fetch this file, and it's unclear why it enters an infinite loop, causing a memory leak.

mkdir -p storybook-static/sb-preview
touch storybook-static/sb-preview/runtime.js

and modify build command

storybook build && sh ./fix-storybook.sh

@coryphil
Copy link

@shilman My apologies for taking so long to respond. My issue with chromatic is that when our builds run the chromatic/storybook part will fail since the build step doesn't "reload the page" (the only current fix for the issues) so loses all its context and gives a bunch of errors about not being able to find things. Feel free to ignore if this comment is no longer useful, I haven't caught up on the other responses and closed issue. Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Empathy Backlog
Development

No branches or pull requests