-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Doesn't work with yarn berry PnP mode #41
Comments
Well... your issue seems to be somewhat beyond my NodeJS experience — I use NPM rather than Yarn; it is the first time I hear about the Yarn PnP environment; and in my head dynamic Thus, not surprised it does not work. I'll need to find time to educate myself about it, and to figure out what should be done about it. Also, at the first glance to your code snippet, my first doubt is that I imagine many projects may have |
Sorry, I provided a bad example there. The path passed to
Yarn Plug'n'Play adds a number of improvements to the node modules resolution system for better reliability & performance. You can read more here: https://yarnpkg.com/features/pnp However, it does apply stricter rules when importing things - modules are not allowed to import things that are not declared in their own closest Note that even if yarn pnp is not being used, using Consider this somewhat contrived file tree:
if |
For the record, I'll copy paste here a relevant note from the release v6.11.0.
|
I tried migrating to this but I get an error when it tries to resolve the path to a css file:
In Yarn PnP environments you cannot use
require
directly to access the dependencies of the packages that use your package. You have to do something like:The text was updated successfully, but these errors were encountered: