profile
viewpoint

Ask questionsStatic files are not correctly served with `netlify dev`

Describe the bug When I run netlify build and then an instance of netlify dev, the static files are not served. The navigator reports a bunch of 404 errors. It happens for pages that contain a getServerSideProps and with target: experimental-serverless-trace.

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/guhur/mre-nextjs-netlify-subfolder
  2. Install the repo and launch the application:
npm install
netlify init
netlify build
netlify dev
  1. Open the navigator on localhost:8888
  2. See the error: no CSS is loaded.

Versions

  • Next.js: 10.1.3
  • plugin (if installed at fixed version): see https://github.com/guhur/mre-nextjs-netlify-subfolder/blob/main/package-lock.json

If you're using the CLI to build

  • OS: Ubuntu 20.04
  • netlify/cli version: 3.17.0

If you're using file-based installation

  • netlify.toml:
[build]
  command = "npm run build"
  publish = "out"
netlify/netlify-plugin-nextjs

Answer questions ascorbic

This is possibly caused by https://github.com/netlify/cli/issues/2990

useful!
source:https://uonfu.com/
answerer
Matt Kane ascorbic @VelaLabs @netlify UK mk.gg Principal engineer @netlify
Github User Rank List