Closed eric-burel closed 2 years ago
yalc
seems to have been proposed as a solution https://www.npmjs.com/package/yalc.
Also hitting this bug with Next.js Webpack versions...
Sister issue in Vulcan Next: https://github.com/VulcanJS/vulcan-next/issues/104, that would provide an efficient solution.
This concerns the development environment, when one want to test the local version of Vulcan NPM in a Vulcan app.
https://github.com/facebook/react/issues/13991 https://github.com/facebook/react/issues/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.