New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Yarn 2 and strict module checking #1015
Comments
This is weird. React Flow doesn't need react-dom. But thanks for the hint. We will check it. |
Can you check v9.3.0? |
Just checked. Seems to be working fine now. Thanks for the quick patch @moklick. |
Just had a relook at this and it seems there are also issues with the type declaration files for react-redux and d3. The error looks like this: .yarn/$$virtual/react-flow-renderer-virtual-1f7b0210b1/0/cache/react-flow-renderer-npm-9.3.0-185ae10f59-07abdc5493.zip/node_modules/react-flow-renderer/dist/types/index.d.ts(2,56): error TS2307: Cannot find module 'd3' or its corresponding type declarations. I think the issue is these types are referenced by the package in .d.ts files, however, they are listed as dev dependencies and therefore are not present in the version that is installed from npm. Therefore, when types are imported via the .d.ts files, yarn 2 will throw an error as it cannot find the type definitions for these libraries. Not sure how would want to fix this. My solution is to add
to my .yarnrc.yml file and therefore add them in as dependencies. |
Thanks. Can you check v9.4.0? |
Looks good now. Thanks! |
I think this commit 51a1fd5 broke this fix. |
I agree with you. I have same problem! |
I am not able to reproduce this. My steps are:
|
added to |
After upgrading to yarn 2, I'm getting the following compile-time error while trying to start a create-react-app application:
Module not found: react-flow-renderer tried to access react-dom, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
I believe this is because yarn 2 only gives access to what's required as a dependency or peer dependency. I'm not sure if this would work, but adding react-dom as a peer dependency might help here.
The text was updated successfully, but these errors were encountered: