Closed simonhrogers closed 1 year ago
Not gonna lie, it does kinda look like your ts config and setup is kind of out of wack. Just had a look-o-look locally and it both complained about the import order and a lot of ts-rules that were not being followed. so as long as you didn't disable all the type checks on build I'm kind of surprised it passed these checks.
Although I agree with the comment @JesseKoldewijn (as in the reproduction is not really minimal and has many unrelated warnings/errors and makes it hard for us to investigate further), I do advise against negative comments like "kind of out of wack". It is not constructive.
@simonhrogers From what I can tell, it sounds like @sanity/ui
is trying to access window
when it should not. (ie. the prerendering of the page at build-time.)
From the build error, it sounds like the problem is here:
This is unlikely a Next.js bug.
Although I agree with the comment @JesseKoldewijn (as in the reproduction is not really minimal and has many unrelated warnings/errors and makes it hard for us to investigate further), I do advise against negative comments like "kind of out of wack". It is not constructive.
@simonhrogers From what I can tell, it sounds like
@sanity/ui
is trying to accesswindow
when it should not. (ie. the prerendering of the page at build-time.)From the build error, it sounds like the problem is here:
This is unlikely a Next.js bug.
Fair, and I apologize for my wording. Have had a lot of hard & long days combined with a recent passing of my grandpa. Nontheless I should not have worded my comment in such a way as I did.
And besides this specific point mentioned above I do agree with ya that the issue at hand here doesn't look like a Next.js bug👌
Thanks both so much for your help! I’ll take this up with the Sanity team.
And sorry yes absolutely no need to apologise, my repo is definitely more than a bit out of whack! The bug struck unexpectedly and at a very inopportune time – sorry for not providing a simpler repo.
Hi all, we got notified by @balazsorban44 and are deploying a fix.
You'll probably need to delete your package-lock.json
, yarn.lock
or pnpm-lock.yaml
file and reinstall to get the fix (after it's released).
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://github.com/simonhrogers/Croydon-Urban-Room
To Reproduce
While hosting this project on Vercel, 50% of deployments will fail for no clear reason.
Describe the Bug
Not apparently due to any particular change in my code, my project is failing/succeeding intermittently with this being the reason. No code change has introduced this error. Local builds don’t seem to error, just on Vercel. All environment variables are correct and nothing was changed that might have affected it when this error started to occur. Even reversing the commit will intermittently pass/fail. The issue started occurring yesterday.
Essentially build success/failure currently seems to be a coin-toss.
My _app.tsx is structure like this, although with or without the
useRouter
this problem persists so I believe it to be irrelevant:and here is my package.json – although I was previously running an older, non-canary version of next (13.1.6) when the issue started so this does not seem to have any relation.
Expected Behavior
All builds to succeed, as they were until this time yesterday.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel