fix(build): add .ts extension to prod webpack configs (Node ≥21)#2352
fix(build): add .ts extension to prod webpack configs (Node ≥21)#2352liviuxyz-ctrl wants to merge 1 commit intochatboxai:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thanks for your contribution! However, I couldn't reproduce this issue on my mac, could you check which version of webpack are you using? |
Description
This PR fixes the “Failed to load …webpack.config.base / ERR_MODULE_NOT_FOUND” build error that occurs on Node ≥ 21 (22 / 23 on Arch, Fedora, etc.).
Main changes
.erb/configs/webpack.config.main.prod.ts.erb/configs/webpack.config.renderer.prod.tschanged
to
Purpose
Node 21+ enforces explicit file-extensions for ESM imports.
Adding
.tslets the prod Webpack configs resolve correctly, restoring a clean build on modern Node without requiring--experimental-specifier-resolution=nodeflags or downstream patches.Additional Notes
npm run buildandnpm run devboth succeed, and the app launches correctly.ERR_MODULE_NOT_FOUNDwhen building on Node 22+).Contributor Agreement
By submitting this Pull Request, I confirm that I have read and agree to the following terms:
Please check the box below to confirm: