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.

Serving built output leads to 404 on routes

See original GitHub issue

Steps to reproduce:

  • Follow the Getting Started guide.
  • Run mdx-deck build deck.mdx.
  • Serve the built public directory. For example, npx serve public. I reproduced with an nginx host as well.
  • Navigate to a slide other than the starting point, for example the second slide (/1).
  • Refresh the page. You’ll see a 404.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jxnblkcommented, Jan 14, 2020

Are you using gatsby serve for this? I’m not sure if your setup would handle the client-side routing the way that Gatsby might expect…

0reactions
imyelocommented, Apr 17, 2020

How about providing a config field that we can switch the router mode to hash router? That will be perfect for a pure static file server in JAMStack likes GitHub Pages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Standlone output + Dynamic Routes results in 404 of /index
The problem is when I build with outputStandalone enabled, the /index shows 404 when I started the service with node .next/standalone/server.js .
Read more >
Angular 2: 404 error occur when I refresh through the browser
To fix the 404 error, you need to update your server to serve the index.html file for each route path you defined. If...
Read more >
How To Properly Serve 404 Errors on SPAs (with SEO in Mind)
When you write your site as a SPA, one of the first steps is to move the "URL routing" logic out of the...
Read more >
How to fix 404 error when accessing a specific URL for create ...
The solution is to set some web server configuration to route all requests to /index.html (that's what the SO article you linked to...
Read more >
Why am I receiving a 404 not found when I try to access a ...
I am using nodejs. When I try to access a route other than “/”, I receive 404 not found. It works https://www.celr.com.br.
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