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

Failed to load preset: "@storybook-vue\\nuxt\\preset" on Windows #6

Closed
g1ronn1mo opened this issue Jul 31, 2023 · 13 comments
Closed

Failed to load preset: "@storybook-vue\\nuxt\\preset" on Windows #6

g1ronn1mo opened this issue Jul 31, 2023 · 13 comments

Comments

@g1ronn1mo
Copy link

g1ronn1mo commented Jul 31, 2023

I used git clone to clone the repo.

I installed with pnpm i

and ran with pnpm storybook dev

I got:

> nuxt-app@ storybook C:\Users\benes\Scripts\test\storybook-nuxt-demo
> storybook dev -p 6006 "dev"

@storybook/cli v7.1.0-rc.1

WARN   Failed to load preset: "@storybook-vue\\nuxt\\preset"
ERR! C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected][email protected]_react_ela7uhthjaw3mu5v4apvscj7ey\node_modules\@storybook-vue\nuxt\dist\preset.mjs:1
ERR! import { join } from 'path';
ERR! ^^^^^^
ERR! 
ERR! SyntaxError: Cannot use import statement outside a module
ERR!     at Object.compileFunction (node:vm:360:18)
ERR!     at wrapSafe (node:internal/modules/cjs/loader:1088:15)
ERR!     at Module._compile (node:internal/modules/cjs/loader:1123:27)   
ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
ERR!     at Object.newLoader [as .mjs] (C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:2262:9)
ERR!     at Module.load (node:internal/modules/cjs/loader:1037:32)       
ERR!     at Module._load (node:internal/modules/cjs/loader:878:12)       
ERR!     at Module.require (node:internal/modules/cjs/loader:1061:19)    
ERR!     at require (node:internal/modules/cjs/helpers:103:18)
ERR!     at Object.<anonymous> (C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected][email protected]_react_ela7uhthjaw3mu5v4apvscj7ey\node_modules\@storybook-vue\nuxt\preset.js:1:18)
ERR!  C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected][email protected]_react_ela7uhthjaw3mu5v4apvscj7ey\node_modules\@storybook-vue\nuxt\dist\preset.mjs:1
ERR! import { join } from 'path';
ERR! ^^^^^^
ERR!
\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:57:1918)
ERR!     at buildDevStandalone (C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:128:1888)
ERR!     at async withTelemetry (C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:113:3659)
ERR!     at async dev (C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:435:401)
ERR!     at async Command.<anonymous> (C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:437:225)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.



I am using Windows 11 with PWSH

@alniv94
Copy link

alniv94 commented Aug 1, 2023

any update on this? got the same error.

@chakAs3
Copy link
Contributor

chakAs3 commented Aug 1, 2023

any update on this? got the same error.

did you update the package ? 0.0.1-rc.4

@alniv94
Copy link

alniv94 commented Aug 1, 2023

any update on this? got the same error.

did you update the package ? 0.0.1-rc.4

I installed with pnpm i

and ran with pnpm storybook dev like in the README instruction

@alniv94
Copy link

alniv94 commented Aug 1, 2023

this is my package.json
image

@chakAs3
Copy link
Contributor

chakAs3 commented Aug 1, 2023

well you still using old version.

you create blank nuxt app and then run the this init command

pnpm i
npx storybook-nuxt@latest init

this will install storybook for you with the necessary config

@happy-turtle
Copy link

I got this error as well on Windows. Switching to a Linux Devcontainer I was able to resolve the error. Maybe it has something to do with path resolution on Windows?

@g1ronn1mo
Copy link
Author

This was, what I thought as well. @chakAs3, use Node.js path.join() Method istead of hard coding the path. I will switch to WSL and have a look, if this will work for me.

@g1ronn1mo g1ronn1mo changed the title Failed to load preset: "@storybook-vue\\nuxt\\preset" Failed to load preset: "@storybook-vue\\nuxt\\preset" on Windows Aug 15, 2023
@chakAs3 chakAs3 closed this as completed Aug 23, 2023
@chakAs3
Copy link
Contributor

chakAs3 commented Aug 23, 2023

@happy-turtle please use the latest version 0.0.3. here the recent demo https://github.com/storybook-vue/storybook-nuxt-starter

@ahmed7am1d
Copy link

@happy-turtle please use the latest version 0.0.3. here the recent demo https://github.com/storybook-vue/storybook-nuxt-starter

Still having the same issue even with the latest version (on Windows 10)

@chakAs3
Copy link
Contributor

chakAs3 commented Aug 26, 2023

@ahmed7am1d i can see the issue is not related to the plugin, some deps are not installed properly, i will update the demo with new versios

@Pecral
Copy link

Pecral commented Sep 13, 2023

@chakAs3 did you update the demo already? The latest checkout of https://github.com/storybook-vue/storybook-nuxt-starter still leads to the same issue on windows 10 / windows 11

@chakAs3
Copy link
Contributor

chakAs3 commented Sep 13, 2023

@chakAs3 did you update the demo already? The latest checkout of https://github.com/storybook-vue/storybook-nuxt-starter still leads to the same issue on windows 10 / windows 11

i will give a try in window and get back to you.

@ZacchNaa
Copy link

ZacchNaa commented Dec 6, 2023

Hi!, Any solution yet, I'm having the same issue on Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants