Next.js Discord

Discord Forum

Random bug appearing on Next.JS Deployment for certain users

Answered
Thrianta posted this in #help-forum
Open in Discord
ThriantaOP
When users try to access the main page, the logs show that the server throws a 500 error for only some users, with this being the nextjs log:

TypeError: Invalid URL
at new URL (node:internal/url:796:36)
at V (/var/task/.next/server/chunks/641.js:7:10417)
at eh (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134786)
at e (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:137671)
at ek (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:138145)
at Array.toJSON (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135755)
at stringify (<anonymous>)
at eR (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142219)
at eE (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142698)
at Timeout._onTimeout (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135475) {
code: 'ERR_INVALID_URL',
input: 'undefined',
digest: '2226716650'
}


Is there any way to fix this, or this is a bug inside of Next.JS itself? Everything was always fine until at some point it appeared.
Answered by American black bear
this doesn't directly solve your problem, but it reliably happens 100% of the time when i clear my cookies on your site
opening a new incognito tab and going to the url will always 500 on the first request, after refresh it works
View full answer

3 Replies

American black bear
this doesn't directly solve your problem, but it reliably happens 100% of the time when i clear my cookies on your site
opening a new incognito tab and going to the url will always 500 on the first request, after refresh it works
Answer
American black bear
specifically the signal-url cookie being empty causes 500
ThriantaOP
Yes, I've had a look and I indeed found the error really quickly! Thank you so much! ❤️