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

WARN Failed to load preset: "@storybook-vue/nuxt/preset" #2

Open
jojomatik opened this issue Jul 27, 2023 · 8 comments
Open

WARN Failed to load preset: "@storybook-vue/nuxt/preset" #2

jojomatik opened this issue Jul 27, 2023 · 8 comments
Assignees

Comments

@jojomatik
Copy link

After switching to this package in my project, I receive the following error.

WARN   Failed to load preset: "@storybook-vue/nuxt/preset"
ERR! Error: Cannot find module '/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook-vue/nuxt/dist/preset.js'
ERR!     at createEsmNotFoundErr (node:internal/modules/cjs/loader:1098:15)
ERR!     at finalizeEsmResolution (node:internal/modules/cjs/loader:1091:15)
ERR!     at resolveExports (node:internal/modules/cjs/loader:567:14)
ERR!     at Module._findPath (node:internal/modules/cjs/loader:[63](https://github.com/jojomatik/nuxt-3-base/actions/runs/5685029360/job/15409035368#step:7:64)6:31)
ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
ERR!     at Module._resolveFilename (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/esbuild-register/dist/node.js:4768:36)
ERR!     at Module._load (node:internal/modules/cjs/loader:922:27)
ERR!     at Module.require (node:internal/modules/cjs/loader:1143:19)
ERR!     at require (node:internal/modules/cjs/helpers:110:18)
ERR!     at interopRequireDefault (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-common/dist/index.js:6:21)
ERR!  Error: Cannot find module '/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook-vue/nuxt/dist/preset.js'
ERR!     at createEsmNotFoundErr (node:internal/modules/cjs/loader:1098:15)
ERR!     at finalizeEsmResolution (node:internal/modules/cjs/loader:1091:15)
ERR!     at resolveExports (node:internal/modules/cjs/loader:567:14)
ERR!     at Module._findPath (node:internal/modules/cjs/loader:636:31)
ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
ERR!     at Module._resolveFilename (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/esbuild-register/dist/node.js:4768:36)
ERR!     at Module._load (node:internal/modules/cjs/loader:922:27)
ERR!     at Module.require (node:internal/modules/cjs/loader:1143:19)
ERR!     at require (node:internal/modules/cjs/helpers:110:18)
ERR!     at interopRequireDefault (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-common/dist/index.js:6:21) {
ERR!   code: 'MODULE_NOT_FOUND',
ERR!   path: '/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook-vue/nuxt/package.json'
ERR! }
ERR! Error: no builder configured!
ERR!     at getPreviewBuilder (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:57:1918)
ERR!     at getBuilders (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:57:2221)
ERR!     at async buildStaticStandalone (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:103:1540)
ERR!     at async withTelemetry (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:113:3[65](https://github.com/jojomatik/nuxt-3-base/actions/runs/5685029360/job/15409035368#step:7:66)9)
ERR!     at async build (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/cli/dist/generate.js:435:1059)
ERR!     at async Command.<anonymous> (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/cli/dist/generate.js:438:125)
ERR!  Error: no builder configured!
ERR!     at getPreviewBuilder (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:57:1[91](https://github.com/jojomatik/nuxt-3-base/actions/runs/5685029360/job/15409035368#step:7:92)8)
ERR!     at getBuilders (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:57:2221)
ERR!     at async buildStaticStandalone (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:103:1540)
ERR!     at async withTelemetry (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/core-server/dist/index.js:113:3659)
ERR!     at async build (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/cli/dist/generate.js:435:1059)
ERR!     at async Command.<anonymous> (/home/runner/work/nuxt-3-base/nuxt-3-base/node_modules/@storybook/cli/dist/generate.js:438:125)

See also this PR jojomatik/nuxt-3-base#273 and workflow https://github.com/jojomatik/nuxt-3-base/actions/runs/5685029360/job/15409035368

@chakAs3 chakAs3 self-assigned this Jul 28, 2023
@chakAs3
Copy link
Contributor

chakAs3 commented Jul 28, 2023

@jojomatik I will fix that, thank you for reporting it

@chakAs3
Copy link
Contributor

chakAs3 commented Jul 31, 2023

@jojomatik can test again to close this issue ?

@g1ronn1mo
Copy link

I still have this error

pnpm storybook ─╯


> @ storybook C:\Users\benes\Scripts\nuxt3-frontend-webapp
> storybook dev -p 6006

@storybook/cli v7.1.1

WARN   Failed to load preset: "@storybook-vue\\nuxt\\preset"
ERR! C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\src\preset.ts:2
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 .ts] (C:\Users\benes\Scripts\nuxt3-frontend-webapp\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\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\preset.js:1:18)
ERR!  C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\src\preset.ts:2
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 .ts] (C:\Users\benes\Scripts\nuxt3-frontend-webapp\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\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\preset.js:1:18)
WARN Could not resolve addon "storybook-addon-nuxt", skipping. Is it installed?
ERR! Error: no builder configured!
ERR!     at getPreviewBuilder (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:57:1918)
ERR!     at buildDevStandalone (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:128:1888)
ERR!     at async withTelemetry (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:113:3725)
ERR!     at async dev (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:457:401)
ERR!     at async Command.<anonymous> (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:459:225)
ERR!  Error: no builder configured!
ERR!     at getPreviewBuilder (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:57:1918)
ERR!     at buildDevStandalone (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:128:1888)
ERR!     at async withTelemetry (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:113:3725)
ERR!     at async dev (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:457:401)
ERR!     at async Command.<anonymous> (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:459:225)

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

WARN Could not resolve addon "storybook-addon-nuxt", skipping. Is it installed?
 ELIFECYCLE  Command failed with exit code 1.
╭─    ~\Scripts\nuxt3-frontend-webapp    main ≡  ?1 ~18 -1                                            18.12.1   11.065s   14:17:48  ─╮ 
╰─ pnpm storybook                                                                                                                                   ─╯ 

> @ storybook C:\Users\benes\Scripts\nuxt3-frontend-webapp
> storybook dev -p 6006

@storybook/cli v7.1.1

WARN   Failed to load preset: "@storybook-vue\\nuxt\\preset"
ERR! Error: Cannot find module './dist/preset'
ERR! Require stack:
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\preset.js
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-common\dist\index.js  
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\telemetry\dist\index.js      
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\bin\index.js
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected]\node_modules\storybook\index.js
ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
ERR!     at Module._resolveFilename (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:4768:36)
ERR!     at Module._load (node:internal/modules/cjs/loader:841:27)
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\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\preset.js:1:18)
ERR!     at Module._compile (node:internal/modules/cjs/loader:1159:14)
ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
ERR!     at Object.newLoader (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:2262:9)
ERR!     at extensions..js (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:4807:24)
ERR!  Error: Cannot find module './dist/preset'
ERR! Require stack:
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\preset.js
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-common\dist\index.js  
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\telemetry\dist\index.js      
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\bin\index.js
ERR! - C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected]\node_modules\storybook\index.js
ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
ERR!     at Module._resolveFilename (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:4768:36)
ERR!     at Module._load (node:internal/modules/cjs/loader:841:27)
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\nuxt3-frontend-webapp\node_modules\.pnpm\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\node_modules\@storybook-vue\nuxt\preset.js:1:18)
ERR!     at Module._compile (node:internal/modules/cjs/loader:1159:14)
ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
ERR!     at Object.newLoader (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:2262:9)
ERR!     at extensions..js (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:4807:24) {
ERR!   code: 'MODULE_NOT_FOUND',
ERR!   requireStack: [
ERR!     'C:\\Users\\benes\\Scripts\\nuxt3-frontend-webapp\\node_modules\\.pnpm\\github.com+storybook-vue+nuxt@a647f44614e67f94da6877d381a9435abcb8ed48_@[email protected]_@v_zlfnxkqenwxpupllcibsyi4zou\\node_modules\\@storybook-vue\\nuxt\\preset.js',
ERR!     'C:\\Users\\benes\\Scripts\\nuxt3-frontend-webapp\\node_modules\\.pnpm\\@[email protected]\\node_modules\\@storybook\\core-common\\dist\\index.js',
ERR!     'C:\\Users\\benes\\Scripts\\nuxt3-frontend-webapp\\node_modules\\.pnpm\\@[email protected]\\node_modules\\@storybook\\telemetry\\dist\\index.js',
ERR!     'C:\\Users\\benes\\Scripts\\nuxt3-frontend-webapp\\node_modules\\.pnpm\\@[email protected]\\node_modules\\@storybook\\cli\\dist\\generate.js',
ERR!     'C:\\Users\\benes\\Scripts\\nuxt3-frontend-webapp\\node_modules\\.pnpm\\@[email protected]\\node_modules\\@storybook\\cli\\bin\\index.js',  
ERR!     'C:\\Users\\benes\\Scripts\\nuxt3-frontend-webapp\\node_modules\\.pnpm\\[email protected]\\node_modules\\storybook\\index.js'
ERR!   ]
ERR! }
ERR! Error: no builder configured!
ERR!     at getPreviewBuilder (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:57:1918)
ERR!     at buildDevStandalone (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:128:1888)
ERR!     at async withTelemetry (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:113:3725)
ERR!     at async dev (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:457:401)
ERR!     at async Command.<anonymous> (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:459:225)
ERR!  Error: no builder configured!
ERR!     at getPreviewBuilder (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:57:1918)
ERR!     at buildDevStandalone (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:128:1888)
ERR!     at async withTelemetry (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\core-server\dist\index.js:113:3725)
ERR!     at async dev (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:457:401)
ERR!     at async Command.<anonymous> (C:\Users\benes\Scripts\nuxt3-frontend-webapp\node_modules\.pnpm\@[email protected]\node_modules\@storybook\cli\dist\generate.js:459:225)

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

 ELIFECYCLE  Command failed with exit code 1.
 
 

@g1ronn1mo
Copy link

How did you install the package? I just run pnpm i storybook-vue/nuxt . Is this right?

@g1ronn1mo
Copy link

g1ronn1mo commented Aug 2, 2023

I had to upgrade to a newer nuxt version

├─┬ @storybook-vue/nuxt 0.1.0-alpha.3
│ └── ✕ unmet peer nuxt@^3.6.5: found 3.6.1

now npx storybook-nuxt init will try to install [email protected] but runs into an other error. npm ERR! code EUNSUPPORTEDPROTOCOL mentined here

@jojomatik
Copy link
Author

jojomatik commented Aug 31, 2023

Hi @chakAs3, sorry for the late reply. I was very involved in different projects over the last few months and didn't have a lot of time for my open source projects.

I've now tried to switch to version 0.0.8 but now I'm having a different error. See https://github.com/jojomatik/nuxt-3-base/actions/runs/6041755557/job/16395397674

Locally I'm actually getting a different error: ERR! Error: no builder configured! Not sure why that is though...

Could you check if you can reproduce that using the PR mentioned in the original issue description?

@g1ronn1mo
Copy link

Hi @chakAs3, sorry for the late reply. I was very involved in different projects over the last few months and didn't have a lot of time for my open source projects.

I've now tried to switch to version 0.0.8 but now I'm having a different error. See https://github.com/jojomatik/nuxt-3-base/actions/runs/6041755557/job/16395397674

Locally I'm actually getting a different error: ERR! Error: no builder configured! Not sure why that is though...

Could you check if you can reproduce that using the PR mentioned in the original issue description?

New Issue opend:
#61 (comment)

@chakAs3
Copy link
Contributor

chakAs3 commented Sep 30, 2023

please check https://storybook.nuxtjs.org/

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

3 participants