-
Notifications
You must be signed in to change notification settings - Fork 917
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
fix vercel deployments version mismatch #544
Conversation
Tried it on weekends too, same result. When I found
Good point. As I understand preview mode is good only for teams
We can (and need to) add it to readme
This is not very good. As an option we can add To sum up: Looks like a decent solution for deployment problem! Great job as always! |
Thanks for testing this out @technophile-04! As I understand by looking at the changed code, this prebuilds the projects and then deploys (so it uses the yarn.lock file), right?. It's a cool solution, but will only solve when deploying from the cli (I guess most people do that? I always do it by connecting the GitHub repo from the Vercel UI). Also, some of the prompts are a bit confusing. I like the default Ideally, we'd want to solve this issue completely. I guess right now it's pnpm vs. locking versions on package.json... which also have their drawbacks. What do you guys think? |
But this does not have any problem, right? Because vercel UI auto-detects its monorepo and also auto-detects where "nextjs" project is right (it considers root Screen.Recording.2023-09-27.at.2.02.12.PM.movUmm I think I have some misunderstandings on why we really need pnpm(which allows shared locked files) OR lock version in package.json now (would really appreciate it if someone could clarify). Summarizing what I understand currently : main issue : "Version mismatch between the local & prod env" i.e. #419 The reason: We are not able to ship monorepo root The "main issue" only happens when deploying through CLI because connecting through GH vercel uses root So I think this PR solves the "main issue" :
Now, what are the added benefits of pnpm(shared .lock files) OR locking versions in
Regarding our
This are my understanding and I might be completely wrong at some places and would really appreciate if someone could clarify 🙏 |
Hey @technophile-04! Thank you so much for the write-up & context. Now I see everything more clearly. Some of the stuff you mentioned was on my notes (I was planning to post it in the pnpm PR, but will do it here) I had a wall of text haha, but since you already did a great job given all the context, let me just comment on it and propose next steps.
Exactly. This is the most «critical» issue. We thought that having separate lock files would fix it (which it will!), but It was weird to me that not so many people were using that feature (and is not present in other package managers) & it seemed a bit unstable. This PR fixes the issue (you are 100% right, it's not an issue when connecting repo in Vercel UI) in a better way 🚀 CLI
Agree with what you said. We can lock versions in package.json (or ~)... and yeah, it can get messy pre-generating so... PNPMIf I remember correctly the main reason we started thinking about PNPM was the issue that this PR is fixing:
(Shiv on #419 (comment)) Yes, I get it, pnpm is fancy and faster (especially if we disabled the per-package lock files) but I don't think it's worth it at this point. It has some issues on Windows (the env vars), and IT'S DAMN HARD TO WRITE, READ AND SAY haha So now I change my 51% (pnpm) / 49% (yarn) vote to 1% (pnpm) / 99% (yarn)... and I'd keep an eye on Bun. It could be a nice option to improve performance. BTW, I think yarn gets a lot of shit, but I think v3 is good & fast enough. Thoughts? |
Awesome job @technophile-04 @rin-st @carletex on these deep thoughts and researching, was nice to read it and try to learn from you!! I've just tried this on Windows, and it's not working exactly like on Mac. The After some noob tries 😅 (will need to explain it well in the Readme 🙌), and finally pulling the project settings, Here is an screenshot: |
Agree 👍
For me main reason is that it's basically breaking change. Users got used to yarn, all the articles/videos use yarn etc. How to write and say it, I don't care. Probably because I don't speak about it 😄 . I have experience working with it, and it's good. It's fast and saves memory on disk. But yes, it's not worth it in our case
Agree!
I tried it. For now, it's not so good for monorepos, for example you can't use scripts from your workspaces in main package.json. But as I understand they're adding features fast so I'm planning to check how it works from time to time And again, if we're deciding to merge this, I believe we should also add info about it to readme/docs |
😆 trust me this same thing came to my mind after writing the comment, love this idea !!
Yup yup, I think incase in the future if we plan to change package manage Also btw in Regarding this PR it seems this is not working as intended on windows :( reason: As shown in SS #544 (comment) first I have created an issue on Vercel -> vercel/vercel#10614 Also while debugging with Pablo on TG chat I noticed Vercel CLI behaves bit different on Windows it rather exits directly instead of prompting (which it does on macOS atleast) So I am leaning towards removing Maybe since #541 was solved we could wait over this weekend to see if Vercel replies if not we can close this PR and even #444 (feeling sad saying this 🥲 lol no JK 😂) And we can make a PR removing |
This is a good idea! (and I think people will like it too). It might be tricky a bit tricky for the docs (when running the commands):
haha. Anyway, we can think about this in future iterations
Yes, let's keep an eye on it and see how it evolves. We can rethink in a few months.
🤣 yeah, that's a complain I got from Austin (I agree tho), since he makes a bunch on live workshops / videos, etc. But like you said, it's a "breaking change".
hahah. I'm super glad we explored & tinkered with that option. But we realized that it's not optimal for us. So... great work <3
Let's regroup next week and see. Thanks all!! I love having these discussions. |
We need to remember about #541 (comment) . Not sure if removing ^ stable enough, and because of it, I'm leaning to pnpm again 😂. But it's much easier to check how locked versions work first.
🥲 🥲 🥲 Sad, I thought we'll go with it
🙏 |
Closing this for now until vercel/vercel#10614 is solved Thanks all 🙌 |
Description
Changes to flow :
1 . Very First time deployment :
The only change is you need to hit extra enter because of the extra first question "No Project Settings found locally....." :
Screen.Recording.2023-09-26.at.9.59.42.AM.1.mov
2 . Deployment to prod or getting preview llink :
yarn vercel:preview
3 . vercel:yolo :
No changes to this
Other options explored :
I was actually trying to get #231 (comment) work by people without needing to specify "packages/nextjs" and tried with different option configuring in
vercel.json
but nothing worked :(Also tried reaching out on Next discord checkout our discusstion thread, summary :
vercel.json
Drawback and Advantages of current approach :
Advantages :
Drawback(which I could think of ) :
yarn vercel-cli
vercel pull
.." might confuse the user about what they need toyarn vercel:preview
vercel logs this at the end :"📝 To deploy to production (test-test-test-test-pi.vercel.app), run
vercel --prod
"this might give the wrong notion to users to use
vercel --prod
where instead they need to do justyarn vercel
for prod deploymentsAlso in case if we go with this please feel free to suggest the script names, I overrided "vercel" since people are habitat for running
yarn vercel
to deploy app directlywe could also do "vercel:ship" etch please feel free to suggest 🙌