Closed tky753 closed 3 weeks ago
System: OS: Windows 11 10.0.22631 CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz Memory: 14.52 GB / 31.95 GB Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527 npmPackages: @modern-js/app-tools: 2.59.0 => 2.59.0 @modern-js/tsconfig: 2.59.0 => 2.59.0
my monorepo structure looks like:
- apps - app1 - modern.config.ts - package.json - app2 - modern.config.ts - package.json - package.json
root package.json has dependencies like:
root package.json
"dependencies": { "@modern-js/runtime": "2.59.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { "@modern-js/app-tools": "2.59.0", "@modern-js/tsconfig": "2.59.0", "typescript": "~5.0.4" }
apps/app1 and app2 inherits dependencies from root
when I run modern dev in foder /apps/app1, the browser shows warning: Warning: ReactDOM.render is no longer supported in React 18.
modern dev
Warning: ReactDOM.render is no longer supported in React 18.
it's because react is an inherited dependency, so the runtimePlugin can't get its version correctly.
react
runtimePlugin
https://github.com/tky753/modern-js-monorepo-bug-report
pnpm i cd apps/app1 pnpm dev
Thanks for the feedback~. Currently, Modern.js requires defining React versions, and we recommend managing versions in sub-projects.
We do not plan to support this behavior for now
Version
Details
my monorepo structure looks like:
root package.json
has dependencies like:apps/app1 and app2 inherits dependencies from root
when I run
modern dev
in foder /apps/app1, the browser shows warning:Warning: ReactDOM.render is no longer supported in React 18.
it's because
react
is an inherited dependency, so theruntimePlugin
can't get its version correctly.Reproduce link
https://github.com/tky753/modern-js-monorepo-bug-report
Reproduce Steps