-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Yarn 2 Dependency Issues #11652
Comments
Just to add context, I updated an app to 9.3.4, ran npm run build on it, and ran into this:
I installed 'find-cache-dir' in my app's dependencies, and that resolved it. |
@paulbjensen that is a workaround, yes, but in that case, those dependencies should really be listed as This is what I'm encountering with yarn 2: Error: next tried to access find-cache-dir, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: find-cache-dir (via "find-cache-dir")
Required by: next@virtual:308db880e6f62e891e71e5b37d20b8a6feac82b6cea97f7dd3c4e797732ec4f2e5079f0015b3ee4f816e93407bdd47bda6f8ae264b19ca8bd9ef518f288df055#npm:9.3.4 (via /D:/dev/source/next/nextjs-yarn2-issue/.yarn/unplugged/next-virtual-c89c8a1136/node_modules/next/dist/compiled/autodll-webpack-plugin/) Okay, I fix that, and I get: Error: next tried to access mkdirp, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: mkdirp (via "mkdirp")
Required by: next@virtual:308db880e6f62e891e71e5b37d20b8a6feac82b6cea97f7dd3c4e797732ec4f2e5079f0015b3ee4f816e93407bdd47bda6f8ae264b19ca8bd9ef518f288df055#npm:9.3.4 (via /D:/dev/source/next/nextjs-yarn2-issue/.yarn/unplugged/next-virtual-c89c8a1136/node_modules/next/dist/compiled/babel-loader/) Okay, install [ error ] ./.yarn/unplugged/next-virtual-c89c8a1136/node_modules/next/dist/client/next-dev.js
TypeError: invalid options argument
at new Promise (<anonymous>)
at Generator.throw (<anonymous>) So now I have to go dig through @timneutkens is there a particular reason why |
This has been fixed already today:
|
Ah, missed the last two PRs. Thanks! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
There seems to be some dependency issues with v9.3.4 when using Yarn 2. First one I ran into seems to be here:
https://github.com/zeit/next.js/blob/7f8f149f9986afd8cb916e27eb231bacaad9dc9d/packages/next/build/utils.ts#L6
I was able to work around it by unplugging
next
, and changing that tonext/dist/compiled/strip-ansi
.But then I started hitting other roadblocks. For example,
autodll-webpack-plugin
is usingfind-cache-dir
(which I noticed is listed as an external), but it is not listed as a dependency for that package. As a matter of fact, itspackage.json
appears to be quite minimal. It looks to me to be a product of the your build process? I'll be honest: I didn't take much time to analyze it. I thought you guys would be better equipped to deal with this.To Reproduce
Clone my reproduction repository
Run
yarn
Run
yarn dev
Expected behavior
It should start the dev server
System information
Additional context
v9.3.3 works fine 🤷♂️
The text was updated successfully, but these errors were encountered: