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.