-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
[Bug]: [vite] Internal server error: Missing "./preview.js" specifier in "@storybook/react" package #23338
Comments
@kamiljurek . We are running into the same issue |
Can confirm having the same issue. Downgrading storybook and addons to 7.0.25 does not work. We are also using nx but just for task execution, but i'm also facing the error when executing "storybook dev -p 6006" from npm scripts. Example Config:
|
Our team confirmed the issue is something with our vite version. Downgrading to |
Just wanted to add the same answer as marcovanharten-cpi. We have the same issue and vite 4.3.9 is working with that issue. so we can confirm the workaround |
Thx vite downgrade to 4.3 solved the issue for now. ❤️ |
I have been pulling my hear for almost 5 hours >..< Locking Vite on 3.9 fixed it! |
This issue should be fixed in vite@4.4.1 |
Closing as this issue has been resolved upstream. |
This error occurs again with storybook v7.6.2, nx v17.1.3 & vite 5.0.4. |
I'm getting something similar but like this:
with vite 4.5.0, vite 5.0.4, vite 4.3.9 and vite 4.4.1 |
having with vite 5.0.9 and Storybook 7.6.4
edit (29/12/23): same with 5.0.10 and Storybook 7.6.6 |
I fixed it by removing ViteFinal optmize deps from .storybook/main.ts I had 👇
|
removing node_modules & .lock files & re-installing the packages fixed the issue for me. |
Storybook 7.6.7 fixes this :) |
Update package @storybook/react to 7.6.9 helped fix this issue. |
If anyone comes across this issue, look very carefully at your storybook main.js file. You may have added some level of configuration that was necessary for older Storybook versions, but not for the latest ones. |
Describe the bug
I am experiencing this error.
Using NX 16.5.0, storybook 7.0.26
commands done:
in the network tab in developer console I see the call:

http://localhost:4400/virtual:/@storybook/builder-vite/vite-app.js which returns 404
added test component is listed on the left side but endless loading circle is showed in the center:
component doesn't render at all.
any hints?
To Reproduce
No response
System
logs:
2:20:07 PM [vite] Internal server error: Missing "./preview.js" specifier in "@storybook/react" package Plugin: vite:import-analysis File: /virtual:/@storybook/builder-vite/vite-app.js at e (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:21424:25) at n (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:21424:627) at o (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:21424:1297) at resolveExportsOrImports (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:28705:20) at resolveDeepImport (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:28724:31) at tryNodeResolve (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:28415:20) at Context.resolveId (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:28176:28) at async Object.resolveId (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:44099:32) at async ModuleGraph._resolveUrl (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:64784:46) at async file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:64702:45 at async Promise.all (index 1) at async ModuleGraph.updateModuleInfo (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:64678:13) at async TransformContext.transform (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:42016:39) at async Object.transform (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:44175:30) at async loadAndTransform (file:///Users/kajurek/repo/bdb/frontend/bdb-monorepo/node_modules/vite/dist/node/chunks/dep-1d3a4915.js:54810:29) ^C%
Additional context
No response
The text was updated successfully, but these errors were encountered: