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

pnpx sv create storybook broken: SB_CORE-SERVER_0002 (CriticalPresetLoadError) #381

Closed
unikitty37 opened this issue Dec 29, 2024 · 1 comment
Labels
bug Something isn't working upstream

Comments

@unikitty37
Copy link

Describe the bug

When using pnpx sv create and selecting Storybook, the installed version of Storybook fails when running it.

Commenting out the '@storybook/addon-svelte-csf' line in .storybook/main.ts allows Storybook to start, but the new CSF syntax can no longer be used.

I'm not sure whether this is a Storybook bug, a bug in Svelte, or a bug in sv create.

Reproduction

https://github.com/unikitty37/sveltekit-storybook-issue

Instructions are in the README.

Logs

@storybook/core v8.4.7

SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./.storybook/main.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.

SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_tyhb6bhjyuiufyc5upvydfzfzy/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_MODULE_NOT_FOUND]: Cannot find module './node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_tyhb6bhjyuiufyc5upvydfzfzy/node_modules/@storybook/addon-svelte-csf/dist/utils/identifier-utils' imported from ./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_tyhb6bhjyuiufyc5upvydfzfzy/node_modules/@storybook/addon-svelte-csf/dist/compiler/pre-transform/codemods/legacy-story.js
    at finalizeResolution (node:internal/modules/esm/resolve:275: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:654:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:603:25)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:353:53)
    at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)
    at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)

More info:

    at loadPreset (./node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:16477:13)

More info:

    at loadPreset (./node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:16477:13)
    at async Promise.all (index 1)
    at async loadPresets (./node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:16487:55)
    at async getPresets (./node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:16520:11)
    at async buildDevStandalone (./node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/core-server/index.cjs:37145:11)
    at async withTelemetry (./node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/core-server/index.cjs:35757:12)
    at async dev (./node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/cli/bin/index.cjs:2591:3)
    at async s.<anonymous> (./node_modules/.pnpm/@[email protected]/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":"/workspaces/testapp/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_tyhb6bhjyuiufyc5upvydfzfzy/node_modules/@storybook/addon-svelte-csf/dist/preset.js"} on level 1
Error [ERR_MODULE_NOT_FOUND]: Cannot find module './node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_tyhb6bhjyuiufyc5upvydfzfzy/node_modules/@storybook/addon-svelte-csf/dist/utils/identifier-utils' imported from ./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_tyhb6bhjyuiufyc5upvydfzfzy/node_modules/@storybook/addon-svelte-csf/dist/compiler/pre-transform/codemods/legacy-story.js
    at finalizeResolution (node:internal/modules/esm/resolve:275: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:654:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:603:25)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:353:53)
    at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)
    at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)
 ELIFECYCLE  Command failed with exit code 1.

System Info

System:
    OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (16) x64 AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
    Memory: 11.29 GB / 27.21 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 22.12.0 - /usr/local/share/nvm/versions/node/v22.12.0/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.9.0 - /usr/local/share/nvm/versions/node/v22.12.0/bin/npm
    pnpm: 9.15.0 - /usr/local/share/nvm/versions/node/v22.12.0/bin/pnpm
  npmPackages:
    svelte: ^5.0.0 => 5.16.0

Severity

blocking an upgrade

@Conduitry Conduitry transferred this issue from sveltejs/svelte Dec 29, 2024
@manuel3108 manuel3108 added bug Something isn't working upstream labels Dec 29, 2024
@manuel3108
Copy link
Member

Duplicate of #320
Duplicate of #379

Pinning for visibility.

@manuel3108 manuel3108 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2024
@manuel3108 manuel3108 pinned this issue Dec 29, 2024
@manuel3108 manuel3108 changed the title pnpx sv create does not include working version of Storybook pnpx sv create storybook broken: SB_CORE-SERVER_0002 (CriticalPresetLoadError) Dec 29, 2024
@manuel3108 manuel3108 unpinned this issue Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants