Running `next build` crashes with "Error: Network error: Only absolute URLs are supported" in v9.4
See original GitHub issueBug report
Describe the bug
Running next build
yields
Creating an optimized production build ...[webpack] Building release "1.0.0_MpfKwURx2xig2RlhnYlLc"
Creating an optimized production build
Compiled successfully.
Automatically optimizing pages ...
Error occurred prerendering page "/404". Read more: https://err.sh/next.js/prerender-error
Error: Network error: Only absolute URLs are supported
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
git clone https://github.com/UnlyEd/next-right-now.git nrn-quick-start
cd nrn-quick-start && git checkout v2-mst-aptd-gcms-lcz-sty && yarn
- Run
next build
Expected behavior
Should build the site
System information
npx envinfo --preset jest
npx: installed 1 in 1.773s
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
npmPackages:
jest: 26.0.1 => 26.0.1
Additional context
Related to
https://github.com/vercel/next.js/discussions/12732 https://github.com/vercel/next.js/pull/12353#issuecomment-627064091
I checked all my fetch()
calls and they use absolute urls. Also I printed logs before to make sure they’re called and they’re not call. So I believe it’s called from within Next when building pages.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Next.js - Error: only absolute urls are supported - Stack Overflow
I'm assuming it has something to do with the different environments (client & server) on which your code can be executed. Relative URLs...
Read more >jest only absolute urls are supported - You.com | The AI ...
vercel/next.jsRunning `next build` crashes with "Error: Network error: Only absolute URLs are supported" in v9.4#13780. Created over 2 years ago.
Read more >Build error - TypeError: Only absolute URLs are supported
With Next.js, running a build will trigger a production build, which requires a service to communicate with first. The build target by ...
Read more >Errors | Node.js v19.3.0 Documentation
Error propagation and interception#. Node.js supports several mechanisms for propagating and handling errors that occur while an application is running. How ...
Read more >Changelog - Cypress Documentation
Fixed an 11.0.0 regression where the migration workflow would error and hang for TypeScript projects. Fixes #24643; Fixed an 11.0.0 regression where cypress...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I recently updated the docs to simplify a lot of the explanation. We only recommend using
.env.local
and then using.env
/.env.development
/.env.production
to set environment defaults. Guess this can be closed then.Sounds a lot like https://github.com/vercel/next.js/issues/12761 🤔