Closed yf-yang closed 2 weeks ago
The cause:
In a pnpm workspace, I install @modern-js/app-tools at the root folder. Therefore, its internal appDirectory
is resolved the root folder. Then modernjs tries to read its package.json to find the react version.
If I execute the command in a workspace folder which installs React 18, then it could not be correctly resolved.
Add @modern.js/app-tools as dependency of workspace folder can fix the issue.
Version
Details
Idk what's wrong here.
It complains when checking
process.env.IS_REACT18
.If modern.config.js set
disableNodePolyfill=false
, then the error goes away, butprocess.env.IS_REACT18
is still not correctly set.Reproduce link
https://github.com/yf-yang/modernjs-monorepo-example/tree/ts-bundler-bug
Reproduce Steps
Then open the browser.