umijs / mako

An extremely fast, production-grade web bundler based on Rust.
https://makojs.dev
MIT License
1.75k stars 65 forks source link

bug: 偶发编译bug #1605

Open chen610620 opened 2 hours ago

chen610620 commented 2 hours ago

由于是公司内部项目, 且项目较大,无法提供太过具体的bug详情。

项目基于前两年的antd design pro进行开发。 已升级到antd v5。 报错是在gitlab上进行cicd时报错(使用docker.fxxk.dedyn.io/node:lts 作为编译容器)。

WORKDIR /app
COPY . .
RUN npm config set strict-ssl false && npm install --legacy-peer-deps --registry=https://registry.npmmirror.com
RUN NODE_ENV=production npm run build

编译报错:

#10 22.75 thread 'rayon thread 0' panicked at crates/mako/src/plugins/tree_shaking/shake/module_concatenate/concatenated_transformer.rs:125:63:
#10 22.75 called `Option::unwrap()` on a `None` value
#10 22.75 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#10 23.79 Rayon: detected unexpected panic; aborting
#10 24.04 Aborted (core dumped)
#10 ERROR: process "/bin/sh -c NODE_ENV=production npm run build" did not complete successfully: exit code: 134
------
 > [build-stage 5/5] RUN NODE_ENV=production npm run build:
------
process "/bin/sh -c NODE_ENV=production npm run build" did not complete successfully: exit code: 134

image

chen610620 commented 2 hours ago

项目为react项目。 前端tsx文件存在循环依赖情况。 依赖方式为 index.tsx => components/abc.tsx => index.tsx

chen610620 commented 8 minutes ago

解决了所有的循环依赖。 但是还是会出现编译报错情况