You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using npm link or yarn link on Lerna packages ends up loading 2 versions of React and React Dom. We might avoid this by making React and React DOM peer dependencies, or using more robust commands in Vulcan Next
Current fix:
In Vulcan NPM, run cd node_modules/react && yarn link, same with react-dom or any problematic duplicate package
In your project, run yarn link react, yarn link react-dom, etc. with any problematic library. This way the Vulcan NPM version will be preferred
Alternative: using Webpack but that's not good.
Possible solution:
Allow to pass a VULCAN_PACKAGE_DIRS env variable like we did in Meteor and handle yarn link ourselves, so the end user doesn't need to know it.
The text was updated successfully, but these errors were encountered:
eric-burel
changed the title
Clean handling of several versions of React
Clean handling of several versions of React - yarn link of node modules with Lerna
Sep 21, 2020
This concerns the development environment, when one want to test the local version of Vulcan NPM in a Vulcan app.
facebook/react#13991
facebook/react#14257
https://stackoverflow.com/questions/34706817/how-prevent-multiple-copies-of-react-from-loading
https://next.material-ui.com/getting-started/faq/#duplicated-module-in-node-modules
https://robkendal.co.uk/blog/2019-12-22-solving-react-hooks-invalid-hook-call-warning
Using
npm link
oryarn link
on Lerna packages ends up loading 2 versions of React and React Dom. We might avoid this by making React and React DOM peer dependencies, or using more robust commands in Vulcan NextCurrent fix:
Vulcan NPM
, runcd node_modules/react && yarn link
, same withreact-dom
or any problematic duplicate packageyarn link react
,yarn link react-dom
, etc. with any problematic library. This way the Vulcan NPM version will be preferredAlternative: using Webpack but that's not good.
Possible solution:
Allow to pass a VULCAN_PACKAGE_DIRS env variable like we did in Meteor and handle
yarn link
ourselves, so the end user doesn't need to know it.The text was updated successfully, but these errors were encountered: