Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'404 Not Found' for all resources #56215

Closed
1 task done
batazor opened this issue Sep 29, 2023 · 7 comments
Closed
1 task done

'404 Not Found' for all resources #56215

batazor opened this issue Sep 29, 2023 · 7 comments
Labels
bug Issue was opened via the bug report template. locked

Comments

@batazor
Copy link

batazor commented Sep 29, 2023

Link to the code that reproduces this issue

https://github.com/shortlink-org/shortlink/tree/main/ui/nx-monorepo

To Reproduce

  1. Upgrade to the latest version nextjs (or > 13.4.6)
  2. cd ./package/next
  3. npm run start

Current vs. Expected behavior

Success starting my project

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.5.0: Mon Apr 24 20:51:50 PDT 2023; root:xnu-8796.121.2~5/RELEASE_X86_64
    Binaries:
      Node: 20.2.0
      npm: 9.6.7
      Yarn: 1.22.19
      pnpm: 8.6.1
    Relevant Packages:
      next: 13.5.2
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: N/A
    Next.js Config:
      output: export

Which area(s) are affected? (Select all that apply)

App Router

Additional context

The application is successfully built, but in development mode for some reason it cannot find the built files

@batazor batazor added the bug Issue was opened via the bug report template. label Sep 29, 2023
@batazor
Copy link
Author

batazor commented Sep 29, 2023

Screenshot 2023-09-29 at 16 36 22

@batazor
Copy link
Author

batazor commented Sep 29, 2023

No assembly errors of any kind are visible. I also tried disabling unnecessary dependencies, but the result didn't change

Screenshot 2023-09-29 at 16 49 57

@khalilsarwari
Copy link

This is happening for us in production when leaving the landing page for the following resource:

_next/static/chunks/webpack-8147f10d25df47dc.js
Request Method:
GET
Status Code:
404 Not Found

@joshuamanns
Copy link

This seems related to #47799 which is a problem with the mime types of static files in standalone builds for some reason.

@paolomainardi
Copy link

Having the same issue as described here: #49283 (comment)

@samcx
Copy link
Member

samcx commented Nov 6, 2024

Hi everyone—

This issue has become stale but the behavior is expected—the static files are 404ing because with output: 'standalone', we automatically create a standalone folder that copies only the necessary files for a production deployment including select files in node_modules.

The minimal server does not copy the public or .next/static folders by default as these should ideally be handled by a CDN instead, although these folders can be copied to the standalone/public and standalone/.next/static folders manually, after which server.js file will serve these automatically.

To copy these and then start this local minimal server locally, you can do something like this:

pnpm build && cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/ && node .next/standalone/server.js

I have also just created a PR to update our documentation with this → #72432.

I will closing this PR since this is a non-issue!

@samcx samcx closed this as completed Nov 6, 2024
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

No branches or pull requests

5 participants