unjs / unbuild

📦 A unified JavaScript build system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

declare报错SyntaxError: Unexpected token

hengshanMWC opened this issue · comments

Environment

System:
OS: macOS 11.4
CPU: (8) arm64 Apple M1
Memory: 327.81 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
npm: 9.7.1 - ~/.nvm/versions/node/v18.12.1/bin/npm
pnpm: 7.21.0 - ~/.nvm/versions/node/v18.12.1/bin/pnpm
Browsers:
Chrome: 116.0.5845.187
Safari: 14.1.1

Reproduction

item
pnpm i
pnpm run build

Describe the bug

image

Additional context

No response

Logs

ℹ Building pkgs                                                                                                           20:18:16
ℹ Cleaning dist directory: ./dist                                                                                         20:18:16

[20:18:17]  ERROR  Error building /Applications/code/github/pkgs: SyntaxError: Unexpected token (4:12) in /Applications/code/github/pkgs/node_modules/.pnpm/@ts-type+package-dts@2.0.8/node_modules/@ts-type/package-dts/package-json.d.ts


[20:18:17]  ERROR  Unexpected token (4:12) in /Applications/code/github/pkgs/node_modules/.pnpm/@ts-type+package-dts@2.0.8/node_modules/@ts-type/package-dts/package-json.d.ts

  at pp$4.raise (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:21616:13)
  at pp$9.unexpected (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18824:8)
  at pp$9.expectContextual (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18778:41)
  at Parser.parseImport (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:26122:14)
  at pp$8.parseStatement (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:19000:49)
  at pp$8.parseTopLevel (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18881:21)
  at Parser.parse (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18653:15)
  at Function.parse (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18703:35)
  at Graph.contextParse (node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:25749:38)
  at tryParse (node_modules/.pnpm/@rollup+plugin-commonjs@25.0.4_rollup@3.29.2/node_modules/@rollup/plugin-commonjs/dist/es/index.js:17:12) 



[20:18:17]  ERROR  Unexpected token (4:12) in /Applications/code/github/pkgs/node_modules/.pnpm/@ts-type+package-dts@2.0.8/node_modules/@ts-type/package-dts/package-json.d.ts

 ELIFECYCLE  Command failed with exit code 1.

Can you please provide a reproduction? 🙏🏼

Same question +1

rollup.dts.respectExternal: false works for me. 💯

Can you please provide a reproduction? 🙏🏼
hi
https://github.com/hengshanMWC/pkgs/tree/unbuild

Can you please provide a reproduction? 🙏🏼

Solved the problem by using Codpoe Method