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.

@nrwl/next static assets 404 with @nrwl/next:server executor

See original GitHub issue

Current Behavior

When using the @nrwl/next:server executor (nx serve), static assets are served only from apps/app/public source folder. Even when we configure project.json like this:

"options": { "root": "apps/app", "outputPath": "dist/apps/app", "assets": [ { "input": "libs/ui/static", "glob": "**/*", "output": "" }, { "input": "libs/ui/icons/assets", "glob": "**/*", "output": "assets/icons" } ] },

This results in 404 resource not found for all static assets that are moved out of the next public folder into the nx library when launching the local dev server with nx serve app

Expected Behavior

nx serve app SHOULD serve static assets according to the configuration in project.json and NOT serve the static assets only from next public folder

Steps to Reproduce

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

image

Environment

“next”: “12.2.3”,

NX Report complete - copy this into the issue template

Node : 16.15.0 OS : linux x64 yarn : 3.2.2

nx : 14.5.4 @nrwl/angular : Not Found @nrwl/cypress : 14.5.4 @nrwl/detox : Not Found @nrwl/devkit : 14.5.4 @nrwl/eslint-plugin-nx : 14.5.4 @nrwl/express : Not Found @nrwl/jest : 14.5.4 @nrwl/js : 14.5.4 @nrwl/linter : 14.5.4 @nrwl/nest : 14.5.4 @nrwl/next : 14.5.4 @nrwl/node : 14.5.4 @nrwl/nx-cloud : 14.3.0 @nrwl/nx-plugin : Not Found @nrwl/react : 14.5.4 @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.5.4 @nrwl/web : 14.5.4 @nrwl/workspace : 14.5.4 typescript : 4.7.4

Community plugins: @nx-go/nx-go: 2.6.0 @nx-tools/nx-docker: 3.0.2 nest-commander-schematics: 3.0.0

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
anthodbcommented, Oct 20, 2022

Any News on this issue?

3reactions
EmilioAiolficommented, Oct 13, 2022

@jaysoo help us

Read more comments on GitHub >

github_iconTop Results From Across the Web

404 Error on Static Assets Within an Optimizely plugin
Resolving 404 issues on static files in razor class libraries using the _content/foo.bar/scripts.js path.
Read more >
Static assets upload returns 404 in production #14121 - GitHub
In production, when I upload an image to the public folder, next.js returns a 404 error when trying to view the image. I...
Read more >
All static files returning 404 error when deploying Django ...
I have now been trying to push it into development and none of the static files are being served. The connection has been...
Read more >
Page loads fine, but all static files return 404 on localhost
Hi, After installing the Starter kit, I noticed that all static files (JS, CSS) return 404 on localhost. The page loads just fine...
Read more >
ords 404 error on static application files - Oracle Communities
Hi, i have APEX 19.2 and ORDS 19.4 in a 12.1.0.2. EE Database. The Static Files are not able to read. I get...
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