nuxt-modules / storybook

Storybook integration with Nuxt.
https://storybook.nuxtjs.org
411 stars 95 forks source link

Cannot build Storybook after version 8.3.0-alpha.3 #804

Open obulat opened 1 month ago

obulat commented 1 month ago

Environment

Nuxt project info:


Storybook: above v.8.3.0-alpha.3

Reproduction

https://github.com/WordPress/openverse/actions/runs/11260782126/job/31312901641?pr=5025

Describe the bug

I tried updating nuxt/storybook to the latest version (to move away from the nightly) in Openverse. The dev mode works fine, but building the storybook fails with the error given below.

I tested with different versions of Storybook, and the error appears in v8.3.0-alpha.4 (and build works fine with v8.3.0-alpha.3).

From v8.3.0-alpha.4 changelog, it seems that [28519] is the biggest PR that might have changed something with the way CJS/mjs files are loaded.

playwright-1  | [WebServer] SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: @storybook-vue/nuxt/preset.
playwright-1  | 
playwright-1  | Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
playwright-1  | 
playwright-1  | If you believe this is a bug, please open an issue on Github.
playwright-1  | 
playwright-1  | /node_modules/.pnpm/ufo@1.5.4/node_modules/ufo/dist/index.mjs:630
playwright-1  | export { $URL, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryKey, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, isScriptProtocol, joinRelativeURL, joinURL, normalizeURL, parseAuth, parseFilename, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withFragment, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutFragment, withoutHost, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash };
playwright-1  | ^^^^^^
playwright-1  | 
playwright-1  | SyntaxError: Unexpected token 'export'
playwright-1  |     at wrapSafe (node:internal/modules/cjs/loader:1281:20)
playwright-1  |     at Module._compile (node:internal/modules/cjs/loader:1321:27)
playwright-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
playwright-1  |     at Object.newLoader [as .mjs] (./node_modules/.pnpm/esbuild-register@3.6.0_esbuild@0.23.1/node_modules/esbuild-register/dist/node.js:2262:9)
playwright-1  |     at Module.load (node:internal/modules/cjs/loader:1208:32)
playwright-1  |     at Module._load (node:internal/modules/cjs/loader:1024:12)
playwright-1  |     at Module.require (node:internal/modules/cjs/loader:1233:19)
playwright-1  |     at require (node:internal/modules/helpers:179:18)
playwright-1  |     at Object.<anonymous> (./node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.cjs:6:13)
playwright-1  |     at Module._compile (node:internal/modules/cjs/loader:1358:14)
playwright-1  | 
playwright-1  | More info: 
playwright-1  | 
playwright-1  |     at loadPreset (./node_modules/.pnpm/@storybook+core@8.3.5/node_modules/@storybook/core/dist/common/index.cjs:139445:13)

You can see this in our CI run: https://github.com/WordPress/openverse/actions/runs/11260782126/job/31312901641?pr=5025

Additional context

I tried updating the module to nightly, but still got the same error