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.

Yarn 2: 404 page does not load

See original GitHub issue

Bug report

Describe the bug

When running next using Yarn 2 and visiting a page in the browser that doesn’t exist, the 404 error page never shows up. Instead it loads forever (“waiting on localhost…”) and then eventually errors with ERR_EMPTY_RESPONSE.

But the terminal shows that the page was compiled:

[ event ] build page: /next/dist/pages/_error
[ wait ]  compiling ...
[ ready ] compiled successfully - ready on http://localhost:3000

To Reproduce

I added a repro here – simply clone and run npm start, dependencies and yarn itself are included

In the terminal:

> mkdir repro
> cd repro
> yarn init -i 2
> yarn add next react react-dom
> mkdir pages
> yarn next

Then open localhost:3000 in the browser.

Expected behavior

The browser receives a response and the 404 page is shown.

System information

  • OS: Windows 10 and Ubuntu 16.04 (within Windows Subsystem for Linux 2)
  • Browser (if applies): Edge 80, probably all others too
  • Version of Next.js: 9.3.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
samwighttcommented, Aug 10, 2021

This is still an issue on Next v.11. This should be re-opened.

2reactions
joneathcommented, Mar 10, 2021

I’m currently still facing this issue on Next 10.0.8

Read more comments on GitHub >

github_iconTop Results From Across the Web

yarn install throw error request failed \"404 Not found"
I found a solution yarn config set registry https://registry.npmjs.org rm yarn.lock yarn.
Read more >
Several Yarn links lead to incorrect urls or 404 not found error ...
Cause. The link rules are not correctly configured or some rules are missing in the Yarn configuration file, rewrite.xml. Answer.
Read more >
Troubleshooting | Yarn
This error simply means that the specified package is requiring something without explicitly declaring it in its dependencies. Since this behavior is unsafe ......
Read more >
Yarn publish does not work (#121668) · Issues - GitLab
A yarn publish fails with a 404 when attempting to publish a package to the NPM registry. This looks it may be more...
Read more >
yarn install - Package not found - Visual Studio Feedback
info If you think this is a bug, please open a bug report with the information provided in "/home/vsts/work/1/s/yarn-error.log". info Visit ...
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