nuxt-modules / storybook

Storybook integration with Nuxt.
https://storybook.nuxtjs.org
378 stars 82 forks source link

Can't use with nuxt 3.12.1, The entry point "vue" cannot be marked as external #641

Closed baixiaoyu2997 closed 2 weeks ago

baixiaoyu2997 commented 2 weeks ago

error log:

> @deorderbook/storybook@0.0.1 prepare:base
> nuxi prepare ../../packages/base --dotenv .env.development

 WARN  [nuxt] Expected @nuxt/schema to be at least 3.12.1 but got 0.0.1. This might lead to unexpected behavior. Check your package.json or refresh your lockfile.                                                              2:35:00 PM

[2:35:03 PM]  WARN  Duplicated imports "CacheMapItem", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useActionCache.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useAsyncCache.ts" is used

✔ Types generated in ../../packages/base/.nuxt                                                                                                                                                                                 2:35:03 PM

> @deorderbook/storybook@0.0.1 prepare:nuxt
> nuxi prepare --dotenv .env.development

 WARN  [nuxt] Expected @nuxt/schema to be at least 3.12.1 but got 0.0.1. This might lead to unexpected behavior. Check your package.json or refresh your lockfile.                                                              2:35:05 PM

[2:35:17 PM]  WARN  Duplicated imports "CacheMapItem", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useActionCache.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useAsyncCache.ts" is used

 WARN  Duplicated imports "useNetwork", the one from "@vueuse/core" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useNetwork.ts" is used                               2:35:17 PM

 WARN  Duplicated imports "useTimestamp", the one from "@vueuse/core" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useTimestamp.ts" is used                           2:35:17 PM

✔ Types generated in .nuxt                                                                                                                                                                                                     2:35:18 PM
@storybook/cli v8.1.6

WARN The following packages are incompatible with Storybook 8.1.6 as they depend on different major versions of Storybook packages:
WARN - storybook-addon-vue-slots@0.9.29
WARN 
WARN 
WARN Please consider updating your packages or contacting the maintainers for compatibility details.
WARN For more on Storybook 8 compatibility, see the linked GitHub issue:
WARN https://github.com/storybookjs/storybook/issues/26031
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
info => Serving static files from ./../../packages/base/public at /
info => Starting manager..
WARN No story files found for the specified pattern: stories/**/*.mdx
WARN No story files found for the specified pattern: stories/**/*.stories.@(js|jsx|mjs|ts|tsx)
info => Starting preview..
[nuxt] Expected `@nuxt/schema` to be at least `3.12.1` but got `0.0.1`. This might lead to unexpected behavior. Check your package.json or refresh your lockfile.
Duplicated imports "CacheMapItem", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useActionCache.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useAsyncCache.ts" is used
Duplicated imports "useNetwork", the one from "@vueuse/core" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useNetwork.ts" is used
Duplicated imports "useTimestamp", the one from "@vueuse/core" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useTimestamp.ts" is used
Duplicated imports "useTokens", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useTokens.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/mocks/useTokens.ts" is used
Duplicated imports "useChains", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useChains.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/mocks/useChains.ts" is used
Duplicated imports "useSwitchChain", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useSwitchChain.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/mocks/useSwitchChain.ts" is used
ℹ Building client...                                                                                                                                                                                                           2:35:46 PM
ℹ vite v5.2.13 building for development...                                                                                                                                                                                     2:35:46 PM
transforming (1) ../../node_modules/.pnpm/nuxt@3.12.1_@opentelemetry+api@1.9.0_@parcel+watcher@2.4.1_@types+node@20.14.2_bufferutil@4.0_qbfdr756rzyp5tee3axvn4nyqq/node_modules/nuxt/dist/app/entry.jsDuplicated imports "CacheMapItem", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useActionCache.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useAsyncCache.ts" is used
Duplicated imports "useNetwork", the one from "@vueuse/core" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useNetwork.ts" is used
Duplicated imports "useTimestamp", the one from "@vueuse/core" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useTimestamp.ts" is used
Duplicated imports "useTokens", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useTokens.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/mocks/useTokens.ts" is used
Duplicated imports "useChains", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useChains.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/mocks/useChains.ts" is used
Duplicated imports "useSwitchChain", the one from "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/composables/useSwitchChain.ts" has been ignored and "/Users/l.rain/Documents/workspace/deorderbook-monorepo/packages/base/mocks/useSwitchChain.ts" is used
ℹ ✓ 1569 modules transformed.                                                                                                                                                                                                  2:36:00 PM
ℹ .nuxt-storybook/dist/client/manifest.json                            4.13 kB │ gzip:   0.77 kB                                                                                                                               2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Poppins-Medium.CWICHMj6.woff2      7.74 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Poppins-Light.CAodptMY.woff2       7.84 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Poppins-Bold.g9MkRaG0.woff2        7.85 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Poppins-Regular.BwTUGeWf.woff2     7.90 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Poppins-SemiBold.DJVo7c07.woff2    7.99 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Inter-Regular.HwlC4K_u.woff2      21.62 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Inter-Light.SRi3KlYD.woff2        22.53 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Inter-Medium.Dg6cnWTD.woff2       22.74 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Inter-SemiBold.CLku1n6t.woff2     22.82 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Inter-Bold.q5z97_RC.woff2         22.94 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/error-bg.CSg96yYH.webp            30.44 kB                                                                                                                                                 2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/index.B_SY1GJM.css                 0.00 kB │ gzip:   0.02 kB                                                                                                                               2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/entry.Bop3rqe0.css                42.27 kB │ gzip:   6.63 kB                                                                                                                               2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/CtKNy-BD.js                        0.29 kB │ gzip:   0.25 kB                                                                                                                               2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/rp_bXKxD.js                      249.05 kB │ gzip:  22.42 kB                                                                                                                               2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/Ny9eeZ7e.js                      252.01 kB │ gzip:  26.43 kB                                                                                                                               2:36:01 PM
ℹ .nuxt-storybook/dist/client/_nuxt/DOD3vPVW.js                      340.43 kB │ gzip: 124.68 kB                                                                                                                               2:36:01 PM
ℹ ✓ built in 15.24s                                                                                                                                                                                                            2:36:01 PM
✔ Client built in 15266ms                                                                                                                                                                                                      2:36:01 PM
ℹ Building server...                                                                                                                                                                                                           2:36:01 PM
ℹ vite v5.2.13 building SSR bundle for development...                                                                                                                                                                          2:36:01 PM
ℹ ✓ 1 modules transformed.                                                                                                                                                                                                     2:36:01 PM
ℹ .nuxt-storybook/dist/server/styles.mjs  0.07 kB                                                                                                                                                                              2:36:01 PM
ℹ .nuxt-storybook/dist/server/server.mjs  0.06 kB                                                                                                                                                                              2:36:01 PM
ℹ ✓ built in 34ms                                                                                                                                                                                                              2:36:01 PM
✔ Server built in 57ms                                                                                                                                                                                                         2:36:01 PM
ℹ Initializing prerenderer                                                                                                                                                                                               nitro 2:36:01 PM
ℹ Prerendering 4 initial routes with crawler                                                                                                                                                                             nitro 2:36:03 PM
  ├─ /index.html (41ms)                                                                                                                                                                                                   nitro 2:36:03 PM
  ├─ /200.html (42ms)                                                                                                                                                                                                     nitro 2:36:03 PM
  ├─ /404.html (42ms)                                                                                                                                                                                                     nitro 2:36:03 PM
  ├─ / (44ms)                                                                                                                                                                                                             nitro 2:36:03 PM
ℹ Prerendered 4 routes in 1.51 seconds                                                                                                                                                                                   nitro 2:36:03 PM
✔ Generated public .vercel/output/static                                                                                                                                                                                 nitro 2:36:03 PM
✔ You can preview this build using npx serve .vercel/output/static                                                                                                                                                       nitro 2:36:03 PM
ℹ Re-optimizing dependencies because lockfile has changed                                                                                                                                                                      2:36:03 PM
╭─────────────────────────────────────────────────────╮                                                                                                                                                                         2:36:03 PM
│                                                     │
│   Storybook 8.1.6 for @storybook-vue/nuxt started   │
│   830 ms for manager and 38 s for preview           │
│                                                     │
│    Local:            http://localhost:9009/         │
│    On your network:  http://10.1.1.150:9009/        │
│                                                     │
╰─────────────────────────────────────────────────────╯
✘ [ERROR] The entry point "vue" cannot be marked as external

 ERROR  Unhandled promise rejection: Build failed with 1 error:                                                                                                                                                                 2:36:06 PM
error: The entry point "vue" cannot be marked as external

  error: The entry point "vue" cannot be marked as external
  at failureErrorWithLog (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js:1651:15)
  at /Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js:1059:25
  at /Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js:1527:9
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

 ERROR  [nitro] [unhandledRejection] Build failed with 1 error:                                                                                                                                                                 2:36:06 PM
error: The entry point "vue" cannot be marked as external

  error: The entry point "vue" cannot be marked as external
  at failureErrorWithLog (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js:1651:15)
  at /Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js:1059:25
  at /Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js:1527:9
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

deps:

"nuxt": "3.12.1",
"@storybook/vue3": "^8.1.6",
"@nuxtjs/storybook": "^8.1.1",
"@storybook/addon-actions": "^8.1.6",
    "@storybook/addon-essentials": "^8.1.6",
    "@storybook/addon-interactions": "^8.1.6",
    "@storybook/addon-links": "^8.1.6",
    "@storybook/blocks": "^8.1.6",
    "@storybook/builder-vite": "^8.1.6",
"@storybook/test": "^8.1.6",
"storybook": "^8.1.6",
    "storybook-addon-vue-slots": "^0.9.29",

I did not enable any nuxt4 features, rolling back nuxt to 3.11.2 can solve this problem

seancrater commented 2 weeks ago

I'm also getting this error in a Nuxt repo with our version set to ^3.11.2.

Ragura commented 2 weeks ago

The examples in the docs also give this error when running pnpm storybook.

Lillojohn commented 2 weeks ago

main.ts

framework: {
    name: "@storybook/vue3-vite",
    options: {},
  },
tobiasdiez commented 2 weeks ago

This is a result of https://github.com/nuxt/nuxt/pull/27372 and is fixed with https://github.com/nuxt-modules/storybook/pull/634.

@chakAs3 could you please release a new version of the storybook addon (packages\storybook-nuxt). Thanks!

chakAs3 commented 1 week ago

First, I have an issue with the package build. Second, using the release script will create a mess with the versions.

image

Previously, my deployment action was simply using pnpm publish with NPM registry credentials. I'm not sure what script you're using after the repo migration, and I'm quite busy these days, so I'm feeling a bit lost.

tobiasdiez commented 4 days ago

@chakAs3 Thanks a lot for the release! In https://github.com/nuxt-modules/storybook/pull/655, I've updated the release script to be compatible with the new repo structure. Just run pnpm release in the root and it will release both the storybook addon and the nuxt module (with the same version).

Could you please also add the NPM deployment token as a secret to github so that I can setup nightly builds? https://github.com/nuxt-modules/storybook/issues/562 That would be awesome!