storybook-vue / storybook-nuxt-demo

Demo for Storybook-nuxt integration
16 stars 5 forks source link

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

Closed g1ronn1mo closed 1 year ago

g1ronn1mo commented 1 year ago

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\@storybook-vue+nuxt@0.0.1-rc.1_@types+node@18.16.19_@vue+compiler-core@3.3.4_nuxt@3.6.5_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\esbuild-register@3.4.2_esbuild@0.18.13\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\@storybook-vue+nuxt@0.0.1-rc.1_@types+node@18.16.19_@vue+compiler-core@3.3.4_nuxt@3.6.5_react_ela7uhthjaw3mu5v4apvscj7ey\node_modules\@storybook-vue\nuxt\preset.js:1:18)
ERR!  C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@storybook-vue+nuxt@0.0.1-rc.1_@types+node@18.16.19_@vue+compiler-core@3.3.4_nuxt@3.6.5_react_ela7uhthjaw3mu5v4apvscj7ey\node_modules\@storybook-vue\nuxt\dist\preset.mjs:1
ERR! import { join } from 'path';
ERR! ^^^^^^
ERR!
\storybook-nuxt-demo\node_modules\.pnpm\@storybook+core-server@7.1.0-rc.1\node_modules\@storybook\core-server\dist\index.js:57:1918)
ERR!     at buildDevStandalone (C:\Users\benes\Scripts\test\storybook-nuxt-demo\node_modules\.pnpm\@storybook+core-server@7.1.0-rc.1\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\@storybook+core-server@7.1.0-rc.1\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\@storybook+cli@7.1.0-rc.1\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\@storybook+cli@7.1.0-rc.1\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 commented 1 year ago

any update on this? got the same error.

chakAs3 commented 1 year ago

any update on this? got the same error.

did you update the package ? 0.0.1-rc.4

alniv94 commented 1 year ago

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 commented 1 year ago

this is my package.json image

chakAs3 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.

chakAs3 commented 1 year ago

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

ahmed7am1d commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 10 months ago

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