fix(template-react-ts): work with newer Node#10304
fix(template-react-ts): work with newer Node#10304chenjiahan merged 1 commit intoweb-infra-dev:mainfrom
Conversation
✅ Deploy Preview for rspack canceled.Built without sensitive environment variables
|
CodSpeed Performance ReportMerging #10304 will not alter performanceComparing Summary
|
|
related to nodejs/node#57298 (comment) and open-telemetry/opentelemetry-js#5415 it seems there's no ideal way to handle this right now, maybe we can generate different template for Node.js >23 |
|
@hardfist It seems that ts-node will have this problem. Rsbuild uses jiti and it works fine. |
|
Here is another issue with |
|
In the meantime I suggest we make two templates that the |
|
@vegerot I fix the template by
it's a temporary fix for the esm support and we still need a better way to support esm but it needs big refactor and will be fixed in separate PR |


Summary:
On my machine running Node v23.11.0, running this example fails with two errors:
__dirnameis undefinedRefreshPluginis an object instead of a classThis commit fixes both of these errors.
Test Plan:
pnpm create rspack@latestpnpm run devBefore this commit: it doesn't work
After this commit: it works