nuxt-modules / storybook

Storybook integration with Nuxt.
https://storybook.nuxtjs.org
401 stars 91 forks source link

Failed to fetch dynamically imported module: sb-vite/deps/@storybook_vue3_dist_entry-preview__mjs.js #731

Open CraigDaveyHornby opened 1 month ago

CraigDaveyHornby commented 1 month ago

I am currently getting the following error when starting up storybook and viewing the local url. I can also see that the same sort of error is present on your examples.

Versions

Package Version
@nuxtjs/storybook ^8.1.4
@storybook-vue/nuxt ^8.1.4
@storybook/addon-a11y ^8.2.4
@storybook/addon-actions ^8.2.4
@storybook/addon-essentials ^8.2.4
@storybook/addon-interactions ^8.2.4
@storybook/addon-links ^8.2.4
@storybook/addon-viewport ^8.2.4
@storybook/blocks ^8.2.4
@storybook/builder-vite ^8.2.4
@storybook/test ^8.2.4

Error

Failed to fetch dynamically imported module: http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/@storybook_vue3_dist_entry-preview__mjs.js?v=9916e1e6
N3P0m commented 1 month ago

Same problem, couldn't solve it?

evgentus-cy commented 1 month ago

Same problem

"nuxt": "3.12.4",
"vue": "3.4.34",
"@nuxtjs/storybook": "8.1.5",
"@storybook-vue/nuxt": "8.1.5",
"@storybook/addon-essentials": "8.2.6",
"@storybook/addon-interactions": "8.2.6",
"@storybook/addon-links": "8.2.6",
"@storybook/addon-viewport": "8.2.6",
"@storybook/blocks": "8.2.6",
"@storybook/builder-vite": "8.2.6",
"@storybook/test": "8.2.6",
"@storybook/types": "8.2.6",
"@storybook/vue3": "8.2.6",
"storybook": "8.2.6",
evgentus-cy commented 1 month ago

Errors in terminal

Error: Build failed with 3 errors:
node_modules/@storybook-vue/nuxt/dist/preview.mjs:5:30: ERROR: Could not resolve "virtual:nuxt-runtime-config"
node_modules/@storybook-vue/nuxt/dist/preview.mjs:6:7: ERROR: Could not resolve "#build/css"
node_modules/@storybook-vue/nuxt/dist/preview.mjs:7:20: ERROR: Could not resolve "#build/plugins"

Versions of @nuxt/vite-builder in yarn.lock are @nuxt/vite-builder@3.12.4", "@nuxt/vite-builder@^3.12.2

evgentus-cy commented 1 month ago

I think this is a copy of https://github.com/nuxt-modules/storybook/issues/718 \ Fix in progress https://github.com/nuxt-modules/storybook/pull/726

tobiasdiez commented 1 month ago

I also got it sometimes, but it disappeared when refreshing the browser. Maybe an issue with vite's dependency optimization.

Tyki commented 1 month ago

Hi, do you have an ETA for the release of this fix ? Thanks for the fix

ouladck commented 1 month ago

I have the same problem

"nuxt": "3.12.4",
"vue": "3.4.35",
"@nuxtjs/storybook": "8.1.5",
"@storybook-vue/nuxt": "8.1.5",
"@storybook/addon-essentials": "8.2.7",
"@storybook/addon-interactions": "8.2.7",
"@storybook/addon-links": "8.2.7",
"@storybook/addon-viewport": "8.2.7",
"@storybook/blocks": "8.2.7",
"@storybook/builder-vite": "8.2.7",
"@storybook/test": "8.2.7",
"@storybook/types": "8.2.7",
"@storybook/vue3": "8.2.7",
"storybook": "8.2.7",

I got this error too:

ERROR  (node:23907) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use node --trace-warnings ... to show where the warning was created)

 ERROR  (node:23907) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time 
tobiasdiez commented 3 weeks ago

This might be related to the upstream bug: https://github.com/storybookjs/storybook/issues/28620

tobiasdiez commented 2 weeks ago

Could someone please provide a minimal reproduction? For me this is no longer occurring in the latest versions.