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

build:package打包失败 #6178

Closed
5 tasks done
xujiajun5175 opened this issue Jul 22, 2024 · 3 comments
Closed
5 tasks done

build:package打包失败 #6178

xujiajun5175 opened this issue Jul 22, 2024 · 3 comments
Labels
good reproduction ✨ This issue provides a good reproduction

Comments

@xujiajun5175
Copy link

描述错误

./es/affix/src/styles
PS C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main> pnpm build:package

[email protected] build:package C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main
pnpm run gen-version && pnpm run clean && pnpm run gen-volar-dts && tsc -b --force tsconfig.esm.json && node scripts/pre-build/pre-cjs-build.js && tsc -b --force tsconfig.cjs.json && rollup -c && node scripts/post-build && rimraf {es,lib}/*.tsbuildinfo

[email protected] gen-version C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main
node scripts/gen-version

[email protected] clean C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main
rimraf site lib es dist node_modules/naive-ui themes/tusimple/es themes/tusimple/lib

[email protected] gen-volar-dts C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main
esbuild scripts/gen-component-declaration.js --bundle --platform=node --tsconfig=tsconfig.esbuild.json | node

C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\src\index.ts → dist/index.js...
[BABEL] Note: The code generator has deoptimised the styling of C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js as it exceeds the max of 500KB.
(!) Circular dependencies
node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/traps.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js
src/dropdown/src/DropdownMenu.tsx -> src/dropdown/src/DropdownGroup.tsx -> src/dropdown/src/DropdownOption.tsx -> src/dropdown/src/DropdownMenu.tsx
src/menu/src/utils.tsx -> src/menu/src/MenuOptionGroup.tsx -> src/menu/src/utils.tsx
src/menu/src/utils.tsx -> src/menu/src/Submenu.tsx -> src/menu/src/utils.tsx
created dist/index.js in 12.2s

C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\src\index.ts → dist/index.prod.js...
[BABEL] Note: The code generator has deoptimised the styling of C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js as it exceeds the max of 500KB.
(!) Circular dependencies
node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/traps.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js
src/dropdown/src/DropdownMenu.tsx -> src/dropdown/src/DropdownGroup.tsx -> src/dropdown/src/DropdownOption.tsx -> src/dropdown/src/DropdownMenu.tsx
src/menu/src/utils.tsx -> src/menu/src/MenuOptionGroup.tsx -> src/menu/src/utils.tsx
src/menu/src/utils.tsx -> src/menu/src/Submenu.tsx -> src/menu/src/utils.tsx
created dist/index.prod.js in 13.8s

C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\src\index.ts → dist/index.mjs...
[BABEL] Note: The code generator has deoptimised the styling of C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js as it exceeds the max of 500KB.
(!) Circular dependencies
node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/traps.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js
src/dropdown/src/DropdownMenu.tsx -> src/dropdown/src/DropdownGroup.tsx -> src/dropdown/src/DropdownOption.tsx -> src/dropdown/src/DropdownMenu.tsx
src/menu/src/utils.tsx -> src/menu/src/MenuOptionGroup.tsx -> src/menu/src/utils.tsx
src/menu/src/utils.tsx -> src/menu/src/Submenu.tsx -> src/menu/src/utils.tsx
created dist/index.mjs in 9.8s

C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\src\index.ts → dist/index.prod.mjs...
[BABEL] Note: The code generator has deoptimised the styling of C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js as it exceeds the max of 500KB.
(!) Circular dependencies
node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/traps.js -> node_modules/.pnpm/[email protected]/node_modules/evtd/es/delegate.js
src/dropdown/src/DropdownMenu.tsx -> src/dropdown/src/DropdownGroup.tsx -> src/dropdown/src/DropdownOption.tsx -> src/dropdown/src/DropdownMenu.tsx
src/menu/src/utils.tsx -> src/menu/src/MenuOptionGroup.tsx -> src/menu/src/utils.tsx
src/menu/src/utils.tsx -> src/menu/src/Submenu.tsx -> src/menu/src/utils.tsx
created dist/index.prod.mjs in 13.5s
node:internal/errors:496
ErrorCaptureStackTrace(err);
^

TypeError: C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\es\calendar\src\Calendar.js: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:405:5)
at validateString (node:internal/validators:162:11)
at Object.join (node:path:429:7)
at guessFullPath (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\scripts\post-build\complete-path.js:162:27)
at parseSource (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\scripts\post-build\complete-path.js:145:9)
at PluginPass.ImportDeclaration (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\scripts\post-build\complete-path.js:21:38)
at newFn (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\visitors.js:160:14)
at NodePath._call (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\path\context.js:47:20)
at NodePath.call (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\path\context.js:37:18)
at NodePath.visit (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\path\context.js:83:31)
at TraversalContext.visitQueue (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\context.js:89:16)
at TraversalContext.visitMultiple (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\context.js:61:17)
at TraversalContext.visit (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\context.js:110:19)
at traverseNode (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\traverse-node.js:22:17)
at NodePath.visit (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\path\context.js:89:52)
at TraversalContext.visitQueue (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\context.js:89:16)
at TraversalContext.visitSingle (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\context.js:65:19)
at TraversalContext.visit (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\context.js:112:19)
at traverseNode (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\traverse-node.js:22:17)
at traverse (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\traverse\lib\index.js:52:34)
at transformFile (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\core\lib\transformation\index.js:82:31)
at transformFile.next ()
at run (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\core\lib\transformation\index.js:24:12)
at run.next ()
at transform (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm@babel [email protected]\node_modules@babel\core\lib\transform.js:22:33)
at transform.next ()
at step (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\gensync\index.js:261:32)
at C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\gensync\index.js:273:13
at async.call.result.err.err (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\gensync\index.js:223:11)
at C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\gensync\index.js:50:45
at step (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\gensync\index.js:287:14)
at C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\gensync\index.js:273:13
at async.call.result.err.err (C:\Users\徐家俊\Downloads\naive-ui-main\naive-ui-main\node_modules.pnpm\[email protected]\node_modules\gensync\index.js:223:11) {
code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v18.20.2

遇到两个问题:
1.第一遍是测试 test 过不去
2.第二遍就是The "path" argument must be of type string. Received undefined

在macos下 会遇到 date-fns找不到 以及 lodash依赖问题

复现步骤

下载最新的包代码
执行pnpm build:package命令

最小复现链接

1

系统信息

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12600KF
    Memory: 43.07 GB / 63.85 GB
  Binaries:
    Node: 18.20.2 - ~\AppData\Local\Volta\tools\image\node\18.20.2\node.EXE
    npm: 10.5.0 - ~\AppData\Local\Volta\tools\image\node\18.20.2\npm.CMD
    pnpm: 9.6.0 - C:\Program Files\Volta\pnpm.EXE
  Browsers:
    Edge: Chromium (126.0.2592.113)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    vue: ~3.4.15 => 3.4.33

使用的包管理器

pnpm

验证

@xujiajun5175 xujiajun5175 added the untriaged need to sort label Jul 22, 2024
@xujiajun5175
Copy link
Author

image
这是打包失败后产物
尝试 压缩成tar.gz文件 导入新vue3项目
image
运行错误如图
image

@jahnli jahnli mentioned this issue Jul 23, 2024
5 tasks
@xujiajun5175
Copy link
Author

xujiajun5175 commented Jul 23, 2024

image

System:
OS: macOS 14.2
CPU: (8) arm64 Apple M1
Memory: 118.84 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.5.0 - ~/.volta/tools/image/node/22.5.0/bin/node
Yarn: 1.22.19 - ~/.volta/bin/yarn
npm: 10.8.2 - ~/.volta/tools/image/node/22.5.0/bin/npm
pnpm: 9.5.0 - ~/.volta/bin/pnpm
bun: 1.0.16 - ~/.bun/bin/bun
Browsers:
Edge: 126.0.2592.113
Safari: 17.2
npmPackages:
vue: ~3.4.15 => 3.4.33

@jahnli jahnli added good reproduction ✨ This issue provides a good reproduction and removed untriaged need to sort labels Sep 23, 2024
@jahnli
Copy link
Collaborator

jahnli commented Sep 25, 2024

重新最新代码重试下

@jahnli jahnli closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good reproduction ✨ This issue provides a good reproduction
Projects
None yet
Development

No branches or pull requests

2 participants