*Some* assets not being prefixed with basePath
when production build deployed to nginx-proxied env
#60787
Replies: 4 comments 3 replies
-
i'm pretty much facing the same issue while deploying a docker image on k8s. |
Beta Was this translation helpful? Give feedback.
-
Same here |
Beta Was this translation helpful? Give feedback.
-
I am also facing same problem. My next js version is 13.5.6 with node 16. When i run app locally with assetprefix then index is loaded correctly but after deployment (docker) then the prefix is going away. One weired observation is - |
Beta Was this translation helpful? Give feedback.
-
hello, is there a fix for this problem, im facing the same issue, but if I do |
Beta Was this translation helpful? Give feedback.
-
I can't open an issue on this because the reproduction steps are so specific, but I am fairly certain this is a bug.
Basically, I have an app where the file structure in the app router looks like:
, where the
@detail
parallel route slot is a sidebar.When I build this project locally, everything works completely fine. However, when I deploy the app to a production environment sitting behind an nginx proxy with a
basePath
in the config, the detail route breaks. After a lot of investigating I have been able to determine, upon refreshing the page on this detail route, that some js assets are 404'ing. Inspecting the html of the page response, I can see that the script tags for these assets do not have thebasePath
prefixed.The two aspects of this issue that are so confusing in conflict with one another are: a) since I can see the dynamically generated html has inconsistent filepath prefixing, this HAS to be an issue with next, right? and yet b) why is it that when I build this same project locally, the assets all have the
basePath
? I've built many versions of this code and the results are consistent, and am running the same version of node etc. in the deployed version.Beta Was this translation helpful? Give feedback.
All reactions