bit link --target
is causing an error with components which use certain dependencies using react
#4740
Labels
bit link --target
is causing an error with components which use certain dependencies using react
#4740
Describe the bug
When using
bit link --target
with a component which hasreact
as a dependency, and running the components in a default Next.js app, it throws the following error:It's not because of 1), as
react
/react-dom
have identical versions in both the Next app and the component library.It's not because of 2), because the components don't break in Bit tests or the Bit development environment.
So it's very likely because of 3). Some components haven't broken with
bit link --target
, such as@sentry/react
:But others do if a component uses them, like
@auth0/auth0-react
:Therefore I strongly suspect it's because these dependencies which break have their own internal copy of React, which is conflicting with Next.js's or the component library's copy of React. I checked and this is the
package.json
of@auth0/auth0-react
:So it looks like the
devDependencies
for React here may be conflicting somehow (it shouldn't because it's a dev dependency, so something else may be going on).Steps to Reproduce
cd my-app && yarn install
cd ../react-tailwind-env && bit install && bit compile && bit link --target ../my-app
cd ../my-app && yarn dev
Expected Behavior
You should receive the described error from the
TailwindButton
component. It's using theAuth0Provider
component example.Specifications
The text was updated successfully, but these errors were encountered: