-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
yarn2 Vercel build failed - No Next.js version could be detected in your project #5280
Comments
Hi @fmal 👋 In this particular case I can't do much. Vercel is currently not supported for Yarn v2 Berry 😿 |
Is there a workaround (say, via vercel.json)? Trying to migrate UPD: Just found this page in Vercel’s knowledge base: https://vercel.com/knowledge/does-vercel-support-yarn-2 |
Update, the only current workaround is to use the node-modules linker. Something is better than nothing ya know. |
The option to set the node linker from "pnp" (default) to "node-modules" works, but this causes a different problem. A fixed insert in the .yarnrc.yml file will cause the option to be set back and forth when using the plug and play mode on a local development machine. The node-linker option "node-modules" should only be necessary when deploying on the Vercel infrastructure. Due to several tests performed on one project, it seems that a Vercel deployment ignores all yarn install steps, such as pre-install before install. Setting the node-linker option at this point is not considered for a deployment! It seems that only the script "vercel-build" within a script of the same name defined in package.json can get overridden. After a brief look into @vercel/next, it becomes clear that there is a way to send your install commands to the deployment process. The definition of these steps seems possible via the dashboard of a project, but I did not try this. The following was tested using the vercel cli. The advantage of the dynamic variant is that the node linker gets set when loading the source code into the infrastructure before initiating the dependencies' installation. In the example, an installation of Yarn Barry also gets executed. A definition of a pre-install command looks like this.
Maybe this helps in some way. Thx! |
You can use env variables to set the node linker, if you define |
@merceyz Even better, I will try that, Thx! |
…es"` env var when executing `yarn` (#5552) ### Related Issues * https://vercel.com/knowledge/does-vercel-support-yarn-2 * #4223 * #4910 * #5136 * #5280 ### 📋 Checklist <!-- Please keep your PR as a Draft until the checklist is complete --> #### Tests - [x] The code changed/added as part of this PR has been covered with tests - [x] All tests pass locally with `yarn test-unit` #### Code Review - [ ] This PR has a concise title and thorough description useful to a reviewer - [ ] Issue from task tracker has a link to this PR
Hello friends. I wanted to notify you that we have added support for Yarn v2 in our official Runtimes ( If you would like to try out the Yarn v2 support before it hits the stable release channel, you can run the following command if you are using the CLI:
If you are using the Git integration to trigger your deployments, then you can define the Please let me know if it works for you or if you bump into any issues! |
Great news @TooTallNate 🎉 I just tried setting |
Confirming that it worked for my project as well. All I had to do is add the environment variable |
…es"` env var when executing `yarn` (#5552) ### Related Issues * https://vercel.com/knowledge/does-vercel-support-yarn-2 * vercel/vercel#4223 * vercel/vercel#4910 * vercel/vercel#5136 * vercel/vercel#5280 ### 📋 Checklist <!-- Please keep your PR as a Draft until the checklist is complete --> #### Tests - [x] The code changed/added as part of this PR has been covered with tests - [x] All tests pass locally with `yarn test-unit` #### Code Review - [ ] This PR has a concise title and thorough description useful to a reviewer - [ ] Issue from task tracker has a link to this PR
A documentation question: the page on the site says that Yarn 2 is only supported for static builds, but is that referring specifically to PnP or is yarn 2 functional when using the node linker? If it's the former, I think the docs should be updated to specify that specifically PnP doesn't work, not all of yarn 2. |
Same problem on vuepress-next. |
I solved it by changing |
…es"` env var when executing `yarn` (#5552) ### Related Issues * https://vercel.com/knowledge/does-vercel-support-yarn-2 * vercel/vercel#4223 * vercel/vercel#4910 * vercel/vercel#5136 * vercel/vercel#5280 ### 📋 Checklist <!-- Please keep your PR as a Draft until the checklist is complete --> #### Tests - [x] The code changed/added as part of this PR has been covered with tests - [x] All tests pass locally with `yarn test-unit` #### Code Review - [ ] This PR has a concise title and thorough description useful to a reviewer - [ ] Issue from task tracker has a link to this PR
I'm using yarn 2 (berry) in PnP mode with offline cache. Project is setup as a monorepo with workspaces. One of the workspaces (
site
) is anext.js
app and obviouslynext.js
is specified as a dependency.This is the deployed files tree:
When deploying the monorepo with Vercel CLI i get the following error in the logs:
Related discussion: #4910
The text was updated successfully, but these errors were encountered: