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

Unpin [email protected] #296

Closed
manuel3108 opened this issue Nov 12, 2024 · 12 comments
Closed

Unpin [email protected] #296

manuel3108 opened this issue Nov 12, 2024 · 12 comments

Comments

@manuel3108
Copy link
Member

In #275 we found out that the latest [email protected] appear to be broken. Same goes for [email protected]. Once they are working again, we should unpin this.

@benmccann
Copy link
Member

I can't reproduce any issue running the following commands:

npx sv create myapp
cd myapp
npx storybook init --skip-install --no-dev
npm install
npm run storybook

It installs and runs storybook 8.4.2 just fine for me

@AdrianGonz97
Copy link
Member

AdrianGonz97 commented Nov 12, 2024

Here's the stack trace:

➜  npx storybook@latest init --skip-install --no-dev
/home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/create-storybook/bin/index.cjs:23
  throw error;
  ^

Error: Cannot find module '@storybook/core/common'
Require stack:
- /home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/storybook/core/common/index.cjs
- /home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/create-storybook/dist/bin/index.cjs
- /home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/create-storybook/bin/index.cjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/storybook/core/common/index.cjs:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/storybook/core/common/index.cjs',
    '/home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/create-storybook/dist/bin/index.cjs',
    '/home/koala/.npm/_npx/6b1ed7b66a76da7f/node_modules/create-storybook/bin/index.cjs'
  ]
}

Node.js v20.18.0

not sure how it's working for you though 🤔

@hansihe
Copy link

hansihe commented Nov 12, 2024

I just followed the exact set of commands you posted @benmccann, I am getting the error below.

Is something with my environment messed up?


> [email protected] storybook
> storybook dev -p 6006

@storybook/core v8.4.2

SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./.storybook/main.ts.

Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.

If you believe this is a bug, please open an issue on Github.

SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./node_modules/@storybook/addon-svelte-csf/dist/preset.js.

Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.

If you believe this is a bug, please open an issue on Github.

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import './node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/story' is not supported resolving ES modules imported from ./node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/index.js
    at finalizeResolution (node:internal/modules/esm/resolve:263:11)
    at moduleResolve (node:internal/modules/esm/resolve:932:10)
    at defaultResolve (node:internal/modules/esm/resolve:1056:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:349:53)
    at new ModuleJobSync (node:internal/modules/esm/module_job:338:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:409:11)
    at new ModuleJobSync (node:internal/modules/esm/module_job:338:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:409:11)

More info:

    at loadPreset (./node_modules/@storybook/core/dist/common/index.cjs:16477:13)

More info:

    at loadPreset (./node_modules/@storybook/core/dist/common/index.cjs:16477:13)
    at async Promise.all (index 1)
    at async loadPresets (./node_modules/@storybook/core/dist/common/index.cjs:16487:55)
    at async getPresets (./node_modules/@storybook/core/dist/common/index.cjs:16520:11)
    at async buildDevStandalone (./node_modules/@storybook/core/dist/core-server/index.cjs:37145:11)
    at async withTelemetry (./node_modules/@storybook/core/dist/core-server/index.cjs:35757:12)
    at async dev (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2591:3)
    at async s.<anonymous> (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2643:74)

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

WARN   Failed to load preset: {"type":"presets","name":"/tmp/myapp/node_modules/@storybook/addon-svelte-csf/dist/preset.js"} on level 1
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import './node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/story' is not supported resolving ES modules imported from ./node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/index.js
    at finalizeResolution (node:internal/modules/esm/resolve:263:11)
    at moduleResolve (node:internal/modules/esm/resolve:932:10)
    at defaultResolve (node:internal/modules/esm/resolve:1056:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:349:53)
    at new ModuleJobSync (node:internal/modules/esm/module_job:338:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:409:11)
    at new ModuleJobSync (node:internal/modules/esm/module_job:338:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:409:11)
(node:337419) ExperimentalWarning: CommonJS module /tmp/myapp/node_modules/@storybook/core/dist/common/index.cjs is loading ES Module /tmp/myapp/node_modules/@storybook/addon-svelte-csf/dist/preset.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
? Would you like to help improve Storybook by sending anonymous crash reports? › (Y/n)

$ npm -v
10.9.0
$ node -v
v23.1.0

@JReinhold
Copy link

I can reproduce @hansihe's error when using Node 23. Downgrading to Node 22 or removing @storybook/addon-svelte-csf from the equation fixes that issue for now.

Filed in storybookjs/addon-svelte-csf#229

@hansihe
Copy link

hansihe commented Nov 12, 2024

Aha, thanks!

@JReinhold
Copy link

JReinhold commented Nov 12, 2024

I also can't reproduce the original error with npx storybook@latest init --skip-install --no-dev, even with a clean npm cache.

@AdrianGonz97 could you try clearing your npx cache and see if that fixes it? Not because that's a fix, but just to rule out any caching issues.

Do you know if you have run a previous version of Storybook on your computer before, even in another project?

Clear the cache with:

npm cache clean --force
rm -rf ~/.npm/_npx

@JReinhold
Copy link

@manuel3108 if you want to, you should be able to pin to 8.4.0 instead, as the offending PR that broke 8.3.7 for you was also introduced in 8.4.1 (and 8.2.10)

@AdrianGonz97
Copy link
Member

thanks, clearing it with rm -rf ~/.npm/_npx alone seems to have done the trick!

Do you know if you have run a previous version of Storybook on your computer before, even in another project?

Yes, though I'm not sure which version it was as we run it quite often here. Presumably it was 8.3.6 since that's the last one that was functioning for both @manuel3108 and I.

@JReinhold
Copy link

Thanks @AdrianGonz97, that's very valuable info! I've yet to be able to reproduce the exact state that causes this though.

@manuel3108
Copy link
Member Author

@manuel3108 if you want to, you should be able to pin to 8.4.0 instead, as the offending PR that broke 8.3.7 for you was also introduced in 8.4.1 (and 8.2.10)

Done, see #298. Though tests don't appear to be passing right now, but this seems to be a docker hub issue right now. Will try again later and report

@manuel3108
Copy link
Member Author

Will try again later and report

v8.4.0 works as expected ✅

@manuel3108
Copy link
Member Author

This has already been done in #181 and we forgot to link that issue. Closing.

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

5 participants