Environment
node: v13.8.0
yarn: 1.22.0
npm: 6.13.7
mac: mojave
There has an error when build from source:
error: Error: Unable to resolve module react-redux from src/init.tsx: react-redux could not be found within the project or in these directories:
node_modules
If you are sure the module exists, try these steps:
I reinstall node\yarn\npm, can't resolve it. Please Help....
Sorry if I missed this in the report, but what are you trying to build? Is a plugin or just the repository checkout? Could you please list the exact steps you took from cloning the repository to what yarn commands you ran?
Hey @passy I started randomly getting this error the other night just trying to yarn start the repo. I have tried deleting ~/.flipper/plugins to force rebuilding the plugins, removed all custom plugin paths, deleted node_modules and re-installed, cleared metro cache and still get the error. I even pulled a fresh copy of the repo into a different directory and yarn && yarn start and got the same error.
Update: I have gone back to the commit for version 0.32.0 and still get this error when I was not getting it on the latest version last week. I suspect it is something being cached outside of the flipper directory
Further Researching: If I go into init.tsx in the src directory and simply comment out the import of react-redux (which is the first one) the error then switches to react-dom (the next one). This makes me feel like it is something with metro that is failing to pull the modules from node_modules
Even more: Logging out Metro internals it seems like it is just looking for index.[ext] at the root of the folders instead of looking at the package json file for the main, module, etc. I am digging into this more to see if I am missing anything in what it is searching.
Can confirm, I have the same issue.
Steps to reproduce
Info
OS: Linux
NPM: 6.13.2
Yarn: 1.22.0
Error
error: Error: Unable to resolve module react-redux from src/init.tsx: react-redux could not be found within the project or in these directories:
node_modules
If you are sure the module exists, try these steps:
Same issue on Arch Linux: I tried to remove yarn and metro caches and re-fetch the whole flipper repo from scratch but it didn't help.
@nikoant ideas?
@mweststrate, no ideas for now, but I also reproduced this on Windows machine. However after yarn reset + yarn install the issue has gone away.
@nikoant Has a fix for this. This should be in master in just a bit.
The fix is in master now, please test it on your machines.
For me works fine now on both macOS and Windows.
One note: I had to kill my watchman instance before the fix worked for me because it didn't seem to pick up the changes to .watchmanconfig automatically.
After that, it worked, too.
The fix worked, thanks.
@nikoant could you please tag a new version so it can be shipped in distros?
Most helpful comment
@nikoant Has a fix for this. This should be in master in just a bit.