Doesn't work on Firefox or Chrome but works on Microsoft Edge

I deployed a static site from the build folder of create react app.

routes.js

const { Router } = require("@xdn/core/router");

module.exports = new Router().get("/:path*", ({ serveStatic }) => {
  serveStatic("build/index.html");
});

The URL is https://ashutosh-kumar-singh-markdown-previewer-default.moovweb-edge.io/

On Firefox I can only see the title i.e. Markdown Previewer and the page is blank

But it works fine on Microsoft Edge browser.

Am I doing something wrong?

It looks like you are serving index.html in response to all requests. You should instead use the path to look up the specific asset to serve, and configure index.html as an app shell.

router
  .get('/static/:path*', ({ serveStatic }) => {
    serveStatic('build/static/:path*')
  })
  .fallback(({ appShell }) => {
    appShell('build/index.html')
  })
1 Like

Thanks a lot @mark.brocato
I was finally able to deploy the React app.