-
Notifications
You must be signed in to change notification settings - Fork 28
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
Error running in yarn due to undeclared dependency #268
Comments
note that it's not "legacy" environments, it's "the standard environment" (ie, npm). |
Thanks for the report @dobesv! This is an unfortunate effect of trying to keep the library free from a direct dependency on react (and react-dom). We could have react-dom listed as a I think the "right" solution here is to make the react dependency a plugin of some sort, or force the user to inject it somehow. This block is where the import happens: happo.io/src/createDynamicEntryPoint.js Line 53 in 0cc7b7b
Do you have a workaround currently? I looked around the wwws and found that you might be able to add this to your .yarnrc.yml: packageExtensions:
happo.io@*:
dependencies:
react-dom: "*"
react: "*" From here: styled-components/styled-components#3082 (comment) |
Yeah it can be worked around changing There are two resolutions to this issue that I know of:
Which you choose depends on the details of what you are up to. My guess is that #1 should work OK. |
It depends on what node/npm versions you support; npm certainly supports peerDependenciesMeta, but versions of npm prior to that will treat the peer dep as required. |
Yarn is strict about using dependencies that are not declared in package.json - if a file imports or requires a module it must be declared in that file's package.json. This differs from npm where a module could use the dependencies of its dependencies freely.
The text was updated successfully, but these errors were encountered: