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
@sebastienva it seems this is a change in node_modules resolution for latest jest. However, the new behaviour IMO is more standards compliant.
In version 20.0.4, jest would resolve react as dependency from current project, however, in new version 23.6.0, jest tries to resolve react from closest node_modules where the dependency is required, i.e. test-lib in your case. Also, If we were to test test-lib on its own, jest resolution will fail to see correct dependency on react.
The fix for this issue can be simple as noted in this PR on your reproducion
Is this a bug report?
I hope. It works with react-script 1.x.
Did you try recovering your dependencies?
I tried on a new app
Which terms did you search for in User Guide?
Lerna, monorepo
Environment
OS: macOS High Sierra 10.13.4
Node: 8.10.0
Yarn: 1.10.1
npm: 5.6.0
Steps to Reproduce
Expected Behavior
Component from lib 'B' is loaded.
Actual Behavior
Cannot find module 'react' from 'index.js'
Reproducible Demo
https://github.com/sebastienva/cra-lerna
This project includes 2 cra apps (test-current : react-script 1, test-next: react-script 2).
Just run yarn install && yarn test.
The text was updated successfully, but these errors were encountered: