-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
v2 global installation does not infer 1.x installed in repository #8309
Comments
Please provide a reproduction. |
Was just about to report this as well. We have a Dockerfile that runs the following: RUN npm install -g turbo
COPY . .
RUN turbo prune --scope=${APP_NAME} --docker When that runs, I get the following error:
Looks to be thrown here: https://github.com/vercel/turbo/blob/67b2a855dbb28b0bcc4d16513f7a89b95c9c3906/crates/turborepo-repository/src/package_manager/mod.rs#L428-L431 Thanks for the workaround @4leite, worked for me. |
https://github.com/4leite/my-turborepo https://github.com/4leite/my-turborepo/actions/runs/9378148823/job/25820887745 |
What would have been useful is an error saying "This turbo config is for v1 and is not compatible with v2 of turbo, please update your configuration" or something similar. |
Same problem... |
Current fix is specify turbo version during docker build to 1.13.4 |
Folks, can you confirm for us that you have @4leite, I do see that you've done so on your reproduction, thank you. For the rest of you, have you installed For context, global I want to make sure that we're not seeing these failures because we're running |
The issue is that it's common when running the --dry-run task, particularly as a first step to decide what other steps to run, to run this globally without running By avoiding having to install the dependencies, we significantly decrease our CI run time. |
Maybe updating some examples that Turbo provides could help avoid these types of issues in future when other major releases happen? I believe quite some people follow docs to setup their apps. Like in the Docker example - https://turbo.build/repo/docs/guides/tools/docker#example There is a Line - Changing examples into something like this (self detecting version, using node):
or this (leave for users to write specific version):
(or even some other, better solutions) could prevent build failures when other major releases happen. |
@MockusT I agree - but that's different from the bug we're seeing here. We're trying to make sure that global 2.x is handling repo-inference correctly. |
I had this issue today but it was slightly different to how it's been described here. My docker builds were failing after running prune at the build step. When I went into the failing layers and ran
This makes me think that even though turbo v1.13.3 was reported as being used (the same version as is in my package.json), the prune step was using the latest I've since updated to turbo v2.0.0 and the issue is fixed, but it took a while to debug and may be confusing to a lot of turbo users. |
Hey, yeah, there will be some awkwardness if global turbo is 2.0 while local turbo is 1.0. Specifically, we now require the |
@4leite I made a mistake earlier. The reproduction you've provided can't infer down to a 1.x version since it was never installed, so it makes sense that Turborepo 2.0 can't interpret a configuration from 1.x. You can either set a version for the |
@buzzie-bee The |
Was this post-prune and inside the output directory? Was the |
Yes this is post prune. I have a build step which runs What @anthonyshew suggested is likely what was going on. When I ran it the first time it used v2.0.0 to do the prune, then after installing it used the locally installed v1.13.3 version which makes sense. Maybe for the future, the docs can suggest to use a pinned version in the examples so a potential v3.0.0 doesn't cause the same issues if the schema changes? I had followed this page I think when I first set it up: https://turbo.build/repo/docs/guides/tools/docker Thanks both for getting back to me so quickly :) |
@anthonyshew Yes, pinning the version is literally what I did as mentioned on the ticket as my workaround. Sorry but "just upgrade" is not good advice for a large project on day 0 of a new release. I'm not asking for you to fix the inference - I agree there's not likely a good solution for this. I'm asking for a better error message when your release breaks existing behavior. "JSON parsing error" gives no indication to the user that what has actually happened is that an unknown new release has broken support for the current features. Usual practice is to deprecate with a warning first and remove in subsequent releases. |
@anthonyshew Hi. I get the following error: Locally, I'm using Any ideas on how to fix this? |
You can use a custom ignore step and set it to |
Hey, folks, want to update here. We're aware that this upgrade process wasn't smooth enough and I want to update with some fixes we've put in place. Code updates
Documentation updatesThe old documentation wasn't good enough to keep you safe during this transition. We made some changes in the initial documentation release and several more over the past couple days.
We can't change the difficulties that we created for you in the near past. Instead, we can do our best for you in the future. From working with folks around the ecosystem and here in this thread, we're finding these changes have helped significantly already. We're also still investigating one larger change for global |
After upgrading to Turbo v2, my Vercel builds also started failing:
|
this is happening on my repo. Preview builds are working but production builds are throwing this error. |
Same issue in development work perfectly but when i push on vercel impossible to deploy same issue...
Look for a solution impossible to find one for the moment ty. |
I've opened a discussion here: https://github.com/orgs/vercel/discussions/7231#discussioncomment-9809507 |
I just solved the problem by moving my dependency to
|
i just try but change nothing when deploy on vercel always same error
Also i use npm: This is my root package.json file
My root turbo.json
My turbo.json of my backend folder whos is in apps/backend who work with express and pug.
My turbo.json file in my folder frontend in apps/frontend who work with nextjs.
When i run the command turbo run dev work perfectly locally but impossible to makes work on deploy on vercel. If anyone has the solution i am really need it. |
@cSarcasme what I also did was to remove all node_modules and yarn.lock files, run yarn install again only on the monorepo root folder to generate a new lock file, and push it.
|
Also if possible, you could try starting your turbo repo from scratch, because only 2 days ago all templates were updated to fix a few issues including the one I ran into: #8192 That is somewhat extreme but could help. |
To update, we're aware of this class of error on Vercel and working towards releasing the fix. |
@anthonyshew thanks for the ack. |
Running into this as well with an upgrade from 1.x.x to 2.0.4. |
Folks, we believe we fixed this error path on Vercel. Could I ask those of you who were running into this before to try a re-deploy? |
I confirm it works now. Thanks for the fast response!
Murilo Pereira
mpereira.dev
…On Thu 20. Jun 2024 at 19:44, Anthony Shew ***@***.***> wrote:
Folks, we believe we fixed this error path on Vercel. Could I ask those of
you who were running into this before to try a re-deploy?
cc @omarish <https://github.com/omarish> @brunofin
<https://github.com/brunofin> @cSarcasme <https://github.com/cSarcasme>
@mpereira <https://github.com/mpereira> 🙏
—
Reply to this email directly, view it on GitHub
<#8309 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3OKS7UMMTYI6YKFF5WKDZIMIHRAVCNFSM6AAAAABIZ3H376VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBRGIYTOMJTHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Looks like we're not receiving any more reports here so going to close this up! |
running pnpm locally and getting this error turbo v2.3.4-canary.5
|
Verify canary release
Link to code that reproduces this issue
https://github.com/4leite/my-turborepo
https://github.com/4leite/my-turborepo/actions/runs/9378148823/job/25820887745
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Linux
Which canary version will you have in your reproduction?
n/a
Describe the Bug
Existing github actions using:
npx -y turbo build --dry-run=json --filter=...[$1]
will pull the latest version v2.x and fails to parse the existing json due to breaking changes.
Expected Behavior
Not sure, but I'm documenting the workaround here, because it was not immediately obvious that a new release had happened or why my build stopped working.
To Reproduce
Any v1 json running:
npx -y turbo build --dry-run=json
Additional context
Workaround is to pin the version of turbo at v1
npx -y turbo@1 build --dry-run=json
The text was updated successfully, but these errors were encountered: