father icon indicating copy to clipboard operation
father copied to clipboard

prebundle errors

Open PeachScript opened this issue 3 years ago • 4 comments

os-locale/@mdx-js/mdx 在 ncc 编译时报错

关联包:@umijs/preset-umi@umijs/plugin-docs ✅ 解法:降级 @vercel/ncc0.33.3,真正原因待排查

Error: For the selected environment is no default ESM chunk format available:
ESM exports can be chosen when 'import()' is available.
JSONP Array push can be chosen when 'document' is available.
Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.

@types/less/@babel/* 在 api-extractor 执行时报错

关联包:@umijs/bundler-utils ❓解法:暂无,但似乎不影响使用

Error: /path/to/node_modules/.pnpm/@[email protected]/node_modules/@types/less/index.d.ts:280:13 - (ae-forgotten-export) The symbol "LessStatic" needs to be exported by the entry point index.d.ts
Error: /path/to/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/typings/babel-parser.d.ts:101:3 - (ae-forgotten-export) The symbol "ParserPlugin" needs to be exported by the entry point index.d.ts
Error: /path/to/node_modules/.pnpm/@[email protected]/node_modules/@babel/types/lib/index.d.ts:8:1 - (ae-forgotten-export) The symbol "BaseComment" needs to be exported by the entry point index.d.ts

api-extractor 无法处理 export = 语法

关联包:rollup-plugin-copy ✅ 解法:api-extractor 暂无支持 export = 的打算(https://github.com/microsoft/rushstack/issues/2220 ),所以 father 对 api-extractor 做了 patch,将 export = 语法用 AST 预处理成 ES Module 再交给 api-extractor 处理,https://github.com/umijs/father-next/commit/f2c9223a3a9597b18178c0057174c5cdda888523

error - InternalError: Internal Error: Unable to analyze the export "Options" in
/path/to/node_modules/.pnpm/[email protected]/node_modules/fast-glob/out/index.d.ts

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

api-extractor 无法处理 export * from '外部模块'

关联包:@types/fs-extra 解法:尝试提了 PR,等 rushstack 答复,https://github.com/microsoft/rushstack/pull/3528

InternalError: Internal Error: getResolvedModule() could not resolve module name "fs"

PeachScript avatar Jun 29 '22 04:06 PeachScript

  1. esm包报错,回退版本到cjs版本先用着 image
  2. 这个报错但不影响使用 image 先记录问题,再解决。 我也遇到了,貌似0.33.3也不行 只要是纯esm包就会包这个错误

txp1035 avatar Jul 29 '22 10:07 txp1035

dayjs 及 globby 预打包失败:https://github.com/umijs/father/issues/650

PeachScript avatar May 18 '23 03:05 PeachScript

os-locale / @mdx-js/mdx / dayjs / globby 这些都可以在 dora 打包成功,可以尝试下是不是缺少一个 esm: false 的参数。

fz6m avatar May 18 '23 17:05 fz6m

先开放 ncc 配置吧 https://github.com/umijs/father/blob/master/src/prebundler/config.ts#L145

beliefgp avatar Nov 12 '24 08:11 beliefgp