Open katocrane opened 1 week ago
I had the same issue with with pnpm build
.
I switched to to using rspack
as the bundler and it fixed this hanging problem.
Seems like it's an issue with the Webpack integration?
In modern.config.js
appTools({
bundler: 'rspack',
}),
Try this package to find the root cause: https://www.npmjs.com/package/why-is-node-running
why-is-node-runningI tried to use this library but it didn't compile into modern.js successfully. Do you have any good code snippets for reference?
You can use it in the edenx.config.ts file
` tools: { styledComponents: false,
webpack: config => {
// 确保 config.plugins 已被定义
config.plugins = config.plugins || [];
// 添加自定义 DonePlugin 插件 在生产环境下保证打包后退出终端命令
if (process.env.NODE_ENV === 'production') {
config.plugins.push({
apply: compiler => {
compiler.hooks.done.tap('DonePlugin', () => {
setTimeout(() => {
console.log('✨ Build completed. Exiting process.');
whyIsNodeRunning();
// process.exit(0); // 构建完成后强制退出
});
});
},
});
}
},
},`
`> yarn build yarn run v1.22.22 warning package.json: No license field $ modern build Modern.js Framework v2.58.2
info Starting production build... info Type checker is enabled. It may take some time. ready Compiled in 18.7 s (web) ✨ Build completed. Exiting process. There are 62 handle(s) keeping the process running.
(unknown stack trace)
(unknown stack trace)
(unknown stack trace)
(unknown stack trace)
error TypeError: Cannot read properties of null (reading 'startsWith')
at /Users/mac/Documents/youjiaassessmanage/node_modules/.cache/bundle-require/modern.config.PENeOo51.cjs:66:77
at Array.filter (
As you can see, I have already integrated it, but it seems to have a problem. I have done a series of troubleshooting but it has not been solved.
Version
Details
本地打包似乎是每次modern.config.ts更改过后进行yarnbuild,就会出现日志已经说明打包完成但是不退出命令行的情况;生产环境的workflow会永远无法退出命令行导致工作流卡住 ![Uploading screenshot-20240903-161933.png…]()
Reproduce link
https://gist.github.com/katocrane/059c64273aa175407b9d99bc01a144ee
Reproduce Steps
执行yarn build