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

[Bug] Fails to load in Node 23 with SB_CORE-SERVER_0002 (CriticalPresetLoadError) #229

Open
JReinhold opened this issue Nov 12, 2024 · 8 comments
Labels
bug Something isn't working has workaround This issue has a possible workaround next Related to the next version

Comments

@JReinhold
Copy link
Collaborator

JReinhold commented Nov 12, 2024

Note

This issue has a temporary workaround

Describe the bug

When starting up a fresh Storybook project (both 8.3 and 8.4) with Svelte 5 and v5 of this addon, it fails to start with the error pasted below.

Downgrading Node to v22 fixes it. So does removing the addon and removing .svelte from the stories glob, which is why I've narrowed it down to this.

Steps to reproduce the behavior

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots and/or logs

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/@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:139445:13)

More info:

    at loadPreset (./node_modules/@storybook/core/dist/common/index.cjs:139445:13)
    at async Promise.all (index 1)
    at async loadPresets (./node_modules/@storybook/core/dist/common/index.cjs:139455:55)
    at async getPresets (./node_modules/@storybook/core/dist/common/index.cjs:139488:11)
    at async buildDevStandalone (./node_modules/@storybook/core/dist/core-server/index.cjs:48473:11)
    at async withTelemetry (./node_modules/@storybook/core/dist/core-server/index.cjs:47080:12)
    at async dev (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2877:3)
    at async r.<anonymous> (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2929:74)

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

WARN   Failed to load preset: {"type":"presets","name":"/Users/jeppe/dev/temp/sv2/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:51681) ExperimentalWarning: CommonJS module /Users/jeppe/dev/temp/sv2/node_modules/@storybook/core/dist/common/index.cjs is loading ES Module /Users/jeppe/dev/temp/sv2/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)
(node:51681) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Environment

Storybook Environment Info:

  System:
    OS: macOS 13.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    **Node: 23.1.0** - ~/Library/Caches/fnm_multishells/45040_1731443426590/bin/node
    npm: 10.9.0 - ~/Library/Caches/fnm_multishells/45040_1731443426590/bin/npm <----- active
    pnpm: 9.12.0 - ~/Library/Caches/fnm_multishells/45040_1731443426590/bin/pnpm
  Browsers:
    Chrome: 130.0.6723.117
    Edge: 130.0.2849.80
    Safari: 16.2
  npmPackages:
    @storybook/addon-essentials: 8.3.6 => 8.3.6
    @storybook/addon-interactions: 8.3.6 => 8.3.6
    @storybook/addon-links: 8.3.6 => 8.3.6
    @storybook/addon-svelte-csf: ^5.0.0-next.11 => 5.0.0-next.11
    @storybook/blocks: 8.3.6 => 8.3.6
    @storybook/svelte: 8.3.6 => 8.3.6
    @storybook/sveltekit: 8.3.6 => 8.3.6
    @storybook/test: 8.3.6 => 8.3.6
    storybook: 8.3.6 => 8.3.6

Additional Context

Originally reported in sveltejs/cli#296 (comment) and sveltejs/cli#295

@JReinhold JReinhold added the bug Something isn't working label Nov 12, 2024
@xeho91
Copy link
Collaborator

xeho91 commented Nov 13, 2024

Hm, so from the initial investigation.

I've been manually fixing the [ERR_UNSUPPORTED_DIR_IMPORT] errors inside node_modules/. Then I ended up with different errors. The last one that blocked me from continuing is:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_prettier@3._uocwypg2nwmmz5omf6wak5chkq/node_modules/@storybook/node-logger/package.json imported from /Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_prettier@3._uocwypg2nwmmz5omf6wak5chkq/node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/story/insert-description.js

While everything seems to be OK inside the package.json exports inside @storybook/node-logger. 🤷

EDIT. I was able to continue the @storybook/node-logger issue by changing:

	"exports": {
		".": {
			"types": "./shim.d.ts",
-                       "import": "./shim.mjs",
+			"default": "./shim.mjs",
			"require": "./shim.js"
		},
		"./package.json": "./package.json"
	},

There either has been some breaking change in Node.js that I am not aware of, or something else is causing all those different errors.


EDIT. I got it working for Node.js v23.
I've replaced every relative imports paths to use package.json#imports.
I'm not yet sure yet how to conclude this issue. Is the Node.js own feature a problem? Should we just stop using package.json#imports (I haven't tested if removing them completely works)?
Or you can't use both relative and package.json#imports at same time?


EDIT. The above solution breaks in Node.js v22 😐 with different error:

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: /Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]._mlbgkp7jlugd2nf3l45vsunbbu/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_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at assert (node:internal/assert:14:11)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:329:5)
    at new ModuleJobSync (node:internal/modules/esm/module_job:313:34)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:314:11)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24)
    at Module._compile (node:internal/modules/cjs/loader:1503:5)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Object.newLoader [as .mjs] (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:2262:9)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)

More info:

    at loadPreset (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:139445:13)

More info:

    at loadPreset (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:139445:13)
    at async Promise.all (index 1)
    at async loadPresets (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:139455:55)
    at async getPresets (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/common/index.cjs:139488:11)
    at async buildDevStandalone (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/core-server/index.cjs:48473:11)
    at async withTelemetry (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/core-server/index.cjs:47080:12)
    at async dev (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/cli/bin/index.cjs:2877:3)
    at async r.<anonymous> (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core/dist/cli/bin/index.cjs:2929:74)

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

WARN   Failed to load preset: {"type":"presets","name":"/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]._mlbgkp7jlugd2nf3l45vsunbbu/node_modules/@storybook/addon-svelte-csf/dist/preset.js"} on level 1
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at assert (node:internal/assert:14:11)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:329:5)
    at new ModuleJobSync (node:internal/modules/esm/module_job:313:34)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:314:11)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24)
    at Module._compile (node:internal/modules/cjs/loader:1503:5)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Object.newLoader [as .mjs] (/Users/xeho91/Nextcloud/Projects/xeho91/xeho91/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:2262:9)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)
(node:89773) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ELIFECYCLE  Command failed with exit code 1.

And to fix this one, I had to revert the change in package.json#exports inside @storybook/node-logger.

@xeho91 xeho91 added the next Related to the next version label Nov 13, 2024
@dominikg
Copy link
Collaborator

fyi i got an [ERR_UNSUPPORTED_DIR_IMPORT] error running storybook + svelte 5 with node 22.12.0 that went away after downgrading to 20.18

@xeho91
Copy link
Collaborator

xeho91 commented Dec 13, 2024

I'm leaning towards theory that something was back ported to Node.js v22.12

Reading the release blog post I think it could possibly have to do something with require(esm) being enabled by default. But, I am still puzzled how this affected this case.

EDIT:
Bingo! It works when flag: --no-experimental-require-module is used, for example:

NODE_OPTIONS="--no-experimental-require-module" pnpm storybook

@xeho91 xeho91 added the has workaround This issue has a possible workaround label Dec 13, 2024
@JReinhold
Copy link
Collaborator Author

JReinhold commented Dec 13, 2024

I'm concluding two things here (and based on some other work I'm doing currently to fix #213)

  1. We need to get rid of the # import maps, Node just behaves funky when it sees them in node_modules, sometimes it respects them, sometimes it ignores them. I think perhaps the feature is only really meant for applications and not libraries, but I haven't found documentation anywhere backing that hunch up. I guess we just have to replace the tests with Vitest mock APIs. If we still want aliases for improved imports (no strong opinion from me, I've never found that useful but I'm also not against it), we can use the alias config in svelte.config.js: https://svelte.dev/docs/kit/configuration#alias and https://svelte.dev/docs/kit/packaging#Best-practices
  2. We need to replace implicit index.js imports with explicit ones, which this ERR_UNSUPPORTED_DIR_IMPORT directly points at. So eg. here:
    import { transformStory } from './story';

    we need to change that:
- import { transformStory } from './story';
+ import { transformStory } from './story/index.js';

I just noticed that is also mentioned in the Svelte docs: https://svelte.dev/docs/kit/packaging#Caveats

We are slightly inconvenienced by the fact that @sveltejs/package does very little bundling and just wraps tsc, but setting tsup or similar up with Svelte and types is non-trivial unfortunately.

@xeho91
Copy link
Collaborator

xeho91 commented Dec 13, 2024

Aye, I'm in favor of removing the package.json#imports.

Given this experience, I agree with your conclusion:

I think perhaps the feature is only really meant for applications and not libraries

@JReinhold
Copy link
Collaborator Author

Note, to truly work with Node 23, we need this released too: storybookjs/storybook#30093

@ryu-man
Copy link

ryu-man commented Dec 25, 2024

I got similar issue when deploying a monorepo project to Vercel; although the build works fine locally, you can checkout the following log from vercel build log

[14:55:37.073] Running build in Washington, D.C., USA (East) – iad1
[14:55:37.951] Cloning github.com/ryu-man/svelte-fui (Branch: ryuman/svelte-5-migration, Commit: 60aa8a2)
[14:55:38.289] Cloning completed: 337.916ms
[14:55:41.953] Restored build cache from previous deployment (BydE3KdQ8DpbDPtpKoxceCET7cNJ)
[14:55:42.046] Running "vercel build"
[14:55:42.521] Vercel CLI 39.2.0
[14:55:44.830] Warning: Detected "engines": { "node": ">=20.x" } in your `package.json` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version
[14:55:44.865] Detected `pnpm-lock.yaml` version 6 generated by [email protected]
[14:55:44.866] Running "install" command: `pnpm install --ignore-scripts`...
[14:55:45.743] Scope: all 5 workspace projects
[14:55:45.908] Lockfile is up to date, resolution step is skipped
[14:55:47.316] Progress: resolved 0, reused 0, downloaded 1, added 0
[14:55:48.328] Progress: resolved 0, reused 0, downloaded 4, added 0
[14:55:48.339] Packages: +408 -862
[14:55:48.340] +++++++++++++++++++++++++-------------------------------------------------------
[14:55:49.351] Progress: resolved 0, reused 0, downloaded 9, added 0
[14:55:50.356] Progress: resolved 0, reused 0, downloaded 17, added 0
[14:55:51.358] Progress: resolved 0, reused 0, downloaded 39, added 0
[14:55:52.359] Progress: resolved 0, reused 0, downloaded 54, added 0
[14:55:53.359] Progress: resolved 0, reused 0, downloaded 92, added 22
[14:55:54.359] Progress: resolved 0, reused 0, downloaded 124, added 46
[14:55:55.361] Progress: resolved 0, reused 0, downloaded 167, added 90
[14:55:56.360] Progress: resolved 0, reused 0, downloaded 228, added 171
[14:55:57.361] Progress: resolved 0, reused 0, downloaded 304, added 236
[14:55:58.361] Progress: resolved 0, reused 0, downloaded 375, added 309
[14:55:59.419] Progress: resolved 0, reused 0, downloaded 444, added 408
[14:55:59.428] Progress: resolved 0, reused 0, downloaded 444, added 408, done
[14:55:59.612] 
[14:55:59.614] Done in 14.5s
[14:56:03.404] 
[14:56:03.405] > @svelte-fui/[email protected] storybook:build /vercel/path0/packages/core
[14:56:03.405] > svelte-kit sync && storybook build
[14:56:03.405] 
[14:56:06.597] If bundling, conditions should include development or production. If not bundling, conditions or NODE_ENV should include development or production. See https://www.npmjs.com/package/esm-env for tips on setting conditions in popular bundlers and runtimes.
[14:56:07.660] �[1m@storybook/core v8.4.7
[14:56:07.660] �[22m
[14:56:07.675] info => Cleaning outputDir: �[36mstorybook-static�[39m
[14:56:07.849] �[33mThe CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.�[39m
[14:56:07.862] info => Loading presets
[14:56:09.048] �[38;2;241;97;97mSB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./.storybook/main.ts.
[14:56:09.049] 
[14:56:09.049] Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
[14:56:09.049] 
[14:56:09.051] If you believe this is a bug, please open an issue on Github.
[14:56:09.051] 
[14:56:09.051] SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: /vercel/path0/node_modules/@storybook/addon-svelte-csf/dist/preset.js.
[14:56:09.051] 
[14:56:09.052] Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
[14:56:09.052] 
[14:56:09.052] If you believe this is a bug, please open an issue on Github.
[14:56:09.052] 
[14:56:09.052] Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/vercel/path0/node_modules/@storybook/addon-svelte-csf/dist/utils/identifier-utils' imported from /vercel/path0/node_modules/@storybook/addon-svelte-csf/dist/compiler/pre-transform/codemods/legacy-story.js
[14:56:09.053]     at finalizeResolution (node:internal/modules/esm/resolve:275:11)
[14:56:09.053]     at moduleResolve (node:internal/modules/esm/resolve:932:10)
[14:56:09.053]     at defaultResolve (node:internal/modules/esm/resolve:1056:11)
[14:56:09.053]     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:654:12)
[14:56:09.053]     at #cachedDefaultResolve (node:internal/modules/esm/loader:603:25)
[14:56:09.054]     at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:353:53)
[14:56:09.054]     at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
[14:56:09.054]     at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)
[14:56:09.054]     at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
[14:56:09.054]     at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)
[14:56:09.055] 
[14:56:09.055] More info: 
[14:56:09.055] 
[14:56:09.055]     at loadPreset (/vercel/path0/node_modules/@storybook/core/dist/common/index.cjs:16477:13)
[14:56:09.056] 
[14:56:09.056] More info: 
[14:56:09.056] �[39m
[14:56:09.056]     at loadPreset (/vercel/path0/node_modules/@storybook/core/dist/common/index.cjs:16477:13)
[14:56:09.056]     at async Promise.all (index 2)
[14:56:09.057]     at async loadPresets (/vercel/path0/node_modules/@storybook/core/dist/common/index.cjs:16487:55)
[14:56:09.057]     at async getPresets (/vercel/path0/node_modules/@storybook/core/dist/common/index.cjs:16520:11)
[14:56:09.057]     at async buildStaticStandalone (/vercel/path0/node_modules/@storybook/core/dist/core-server/index.cjs:35384:11)
[14:56:09.057]     at async withTelemetry (/vercel/path0/node_modules/@storybook/core/dist/core-server/index.cjs:35757:12)
[14:56:09.058]     at async build (/vercel/path0/node_modules/@storybook/core/dist/cli/bin/index.cjs:2555:3)
[14:56:09.058]     at async s.<anonymous> (/vercel/path0/node_modules/@storybook/core/dist/cli/bin/index.cjs:2661:7)
[14:56:09.061] WARN   Failed to load preset: {"type":"presets","name":"/vercel/path0/node_modules/@storybook/addon-svelte-csf/dist/preset.js"} on level 1
[14:56:09.061] �[38;2;241;97;97mError [ERR_MODULE_NOT_FOUND]: Cannot find module '/vercel/path0/node_modules/@storybook/addon-svelte-csf/dist/utils/identifier-utils' imported from /vercel/path0/node_modules/@storybook/addon-svelte-csf/dist/compiler/pre-transform/codemods/legacy-story.js�[39m
[14:56:09.061]     at finalizeResolution (node:internal/modules/esm/resolve:275:11)
[14:56:09.062]     at moduleResolve (node:internal/modules/esm/resolve:932:10)
[14:56:09.062]     at defaultResolve (node:internal/modules/esm/resolve:1056:11)
[14:56:09.062]     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:654:12)
[14:56:09.062]     at #cachedDefaultResolve (node:internal/modules/esm/loader:603:25)
[14:56:09.063]     at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:353:53)
[14:56:09.063]     at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
[14:56:09.063]     at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)
[14:56:09.063]     at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
[14:56:09.063]     at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:413:11)
[14:56:09.093] 
[14:56:09.094] �[35m�[1mattention�[22m�[39m => Storybook now collects completely anonymous telemetry regarding usage.
[14:56:09.094] This information is used to shape Storybook's roadmap and prioritize features.
[14:56:09.094] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[14:56:09.094] �[36mhttps://storybook.js.org/telemetry�[39m
[14:56:09.095] 
[14:56:09.635]  ELIFECYCLE  Command failed with exit code 1.
[14:56:09.654] Error: Command "cd packages/core&& pnpm run storybook:build" exited with 1
[14:56:09.996] 

@JReinhold
Copy link
Collaborator Author

@ryu-man looking at this log output, I'd expect your Vercel environment is using Node 23:

Warning: Detected "engines": { "node": ">=20.x" } in your `package.json` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version

I'd strongly suggest you pin that engines version in general, to not auto-upgrade to major versions. However if you can't/won't do that, you should try upgrading this addon's version to the most recent prerelease, along with Storybook core to 8.5.0-beta.5 which should hopefully fix Node 23 compatibility. Core storybook can be upgraded with:

npx storybook@next upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has workaround This issue has a possible workaround next Related to the next version
Projects
None yet
Development

No branches or pull requests

4 participants