You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In Nuxt, you can specify the app.baseUrl config to run the app in a "subfolder". That does work well locally in dev mode and also when running via npm run build && nuxi start.
We run a reverse proxy to ONLY serve our app at domain.com/my-page/ (and everything else like domain.com is non-nuxt)
It does not work when deploying to hub.nuxt.com. It also does not work with vanilla cloudflare pages and it also does not work for netlify. So it's probably not a nuxt-hub only issue, but maybe there is a way how to configure this on nuxt-hub/cloudflare to make it work.
When adding a baseUrl like /my-page/ then website runs at domain.com/my-page. Nuxt also correctly requests all assets from there, e.g.
domain.com/my-page/_nuxt/abc123.js
domain.com/my-page/_nuxt/abc123.css
domain.com/my-page/my-images/logo.png
The problem is, that npm run build does not output _nuxt/ at that location but at the root. So you can actually open
domain.com/_nuxt/abc123.js --> status 200
domain.com/my-page/_nuxt/abc123.js --> status 404
We run a reverse proxy to ONLY serve our app at domain.com/my-page/, so you would never find the assets at the root. They should be correctly served from domain.com/my-page/_nuxt/abc123.js. Contents of dist should be found at domain.com/my-page/
There is an upstream issue here: nitrojs/nitro#1484
But I am not sure if this is something need to be configured on Hub/Cloudflare side.
Steps to reproduce
Steps to reproduce the behavior:
Deploy an app with app.baseUrl set to non-empty, like /my-page
See that the app does not work, as it won't find any asset.
Expected behavior
Contents of dist should be found at domain.com/my-page/
The text was updated successfully, but these errors were encountered:
Describe the bug
In Nuxt, you can specify the app.baseUrl config to run the app in a "subfolder". That does work well locally in dev mode and also when running via
npm run build && nuxi start
.We run a reverse proxy to ONLY serve our app at
domain.com/my-page/
(and everything else like domain.com is non-nuxt)It does not work when deploying to hub.nuxt.com. It also does not work with vanilla cloudflare pages and it also does not work for netlify. So it's probably not a nuxt-hub only issue, but maybe there is a way how to configure this on nuxt-hub/cloudflare to make it work.
When adding a baseUrl like
/my-page/
then website runs atdomain.com/my-page
. Nuxt also correctly requests all assets from there, e.g.domain.com/my-page/_nuxt/abc123.js
domain.com/my-page/_nuxt/abc123.css
domain.com/my-page/my-images/logo.png
The problem is, that
npm run build
does not output_nuxt/
at that location but at the root. So you can actually opendomain.com/_nuxt/abc123.js
--> status 200domain.com/my-page/_nuxt/abc123.js
--> status 404We run a reverse proxy to ONLY serve our app at
domain.com/my-page/
, so you would never find the assets at the root. They should be correctly served fromdomain.com/my-page/_nuxt/abc123.js
. Contents ofdist
should be found atdomain.com/my-page/
There is an upstream issue here: nitrojs/nitro#1484
But I am not sure if this is something need to be configured on Hub/Cloudflare side.
Steps to reproduce
Steps to reproduce the behavior:
app.baseUrl
set to non-empty, like/my-page
Expected behavior
dist
should be found atdomain.com/my-page/
The text was updated successfully, but these errors were encountered: