question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running `next build` crashes with "Error: Network error: Only absolute URLs are supported" in v9.4

See original GitHub issue

Bug 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:

  1. git clone https://github.com/UnlyEd/next-right-now.git nrn-quick-start
  2. cd nrn-quick-start && git checkout v2-mst-aptd-gcms-lcz-sty && yarn
  3. 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
timneutkenscommented, Jun 5, 2020

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.

1reaction
timneutkenscommented, Jun 5, 2020
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found