Replies: 2 comments
-
nothing yet? |
Beta Was this translation helpful? Give feedback.
0 replies
-
It happen on v5 too when attempt to deploy on Vercel TypeError [ERR_INVALID_URL]: Invalid URL
--
22:44:35.652 | at new NodeError (node:internal/errors:405:5)
22:44:35.660 | at new URL (node:internal/url:637:13)
22:44:35.660 | at 78021 (/vercel/path0/.next/server/app/_not-found.js:1:8158)
22:44:35.660 | at Function.t (/vercel/path0/.next/server/webpack-runtime.js:1:127)
22:44:35.661 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
22:44:35.661 | at async collectGenerateParams (/vercel/path0/node_modules/next/dist/build/utils.js:884:17)
22:44:35.661 | at async /vercel/path0/node_modules/next/dist/build/utils.js:1100:17
22:44:35.664 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:147:20) {
22:44:35.664 | input: 'xxx-9u4of93ae-mcs.vercel.app',
22:44:35.664 | code: 'ERR_INVALID_URL' |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment
System:
OS: Windows 10 10.0.22000
CPU: (4) x64 Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Memory: 25.43 GB / 32.00 GB
Binaries:
Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0), Chromium (113.0.1774.57)
Internet Explorer: 11.0.22000.120
Reproduction URL
http://localhost:3000
Describe the issue
Build fails on my production server with this error:
Collecting page data ..TypeError [ERR_INVALID_URL]: Invalid URL at new NodeError (node:internal/errors:399:5) at new URL (node:internal/url:560:13) at parseUrl (C:\Repositories\Dev\Sitecore XM Cloud\src\sxastarter\node_modules\next-auth\utils\parse-url.js:17:16) at Object.<anonymous> (C:\Repositories\Dev\Sitecore XM Cloud\src\sxastarter\node_modules\next-auth\react\index.js:72:34) at Module._compile (node:internal/modules/cjs/loader:1254:14) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) at Module.require (node:internal/modules/cjs/loader:1141:19) at require (node:internal/modules/cjs/helpers:110:18) { input: '', code: 'ERR_INVALID_URL'
The build went gone on my local, so after some test I got it:
in local I have .env e .env.local files, the first one with empty parameters
`AZURE_AD_B2C_TENANT_NAME=
AZURE_AD_B2C_CLIENT_ID=
AZURE_AD_B2C_CLIENT_SECRET=
AZURE_AD_B2C_PRIMARY_USER_FLOW=
NEXTAUTH_URL=
NEXTAUTH_SECRET=`
and the .local the same but with actuals values, so the build goes.
But if I remove values from .env.local on my machine and I got the same error.
So .env.local is mandatory for builds?
But in production we have only .env file, the values are filled during delpoy (not build) with environments variables, we use Azure pipelines, not Vercel
How to reproduce
make a build on production removing fields on .env.local
Expected behavior
The build, at least on production, should go, regardless presence on .env parameteres.
Errors of missing values in .env should occurs on runtime
Beta Was this translation helpful? Give feedback.
All reactions