Generate static build with app.baseUrl
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v16.15.1
- Nuxt Version:
3.0.0-rc.3
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
modules
,colorMode
,content
- Runtime Modules:
@nuxt/content@2.0.1
,@nuxtjs/tailwindcss@5.1.2
,@nuxtjs/color-mode@3.0.3
- Build Modules:
-
Reproduction
- git clone https://github.com/Atinux/content-wind
- cd content-wind
- yarn
- NUXT_APP_BASE_URL=/sub/ yarn generate
Describe the bug
During prerender, it seems that the /api
path does not contains the app.baseUrl
provided by nuxt (neither env or configuration in nuxt.config
)
Additional context
No response
Logs
ℹ Prerendering 2 initial routes with crawler nitro 17:51:21
├─ / (751ms) nitro 17:51:21
├─ /api/_content/cache (9ms) nitro 17:51:21
├─ /api/_content/navigation (5ms) nitro 17:51:21
├─ /api/_content/query/1354861641 (3ms) nitro 17:51:21
├─ /sub/ (17ms) nitro 17:51:21
├─ /sub/about (16ms) nitro 17:51:21
├─ /sub/test (21ms) nitro 17:51:21
├─ /api/_content/query/4205208744 (3ms) (Error: [404] Document not found!) nitro 17:51:21
├─ /api/_content/query/896285848 (3ms) (Error: [404] Document not found!) nitro 17:51:21
├─ /api/_content/query/1501933505 (3ms) (Error: [404] Document not found!) nitro 17:51:21
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
nuxt.js - Why baseURL in nuxt builded app always like ...
I faced with problem: when running 'nuxt generate' process.server is true and process.browser is false. During generating, nuxt send queries to ...
Read more >Configure the create-react-app public URL post-build with ...
For a project, I had the requirement of making the public URL of the application configurable via an environment variable that can be...
Read more >Deployment | Create React App
The build folder with static assets is the only output produced by Create React App. However this is not quite enough if you...
Read more >How could make baseURL settings support multi domains?
There is another way, by setting a different destination path for built files. I think the command is hugo -d so say hugo...
Read more >An elegant solution of deploying React app into a subdirectory
An instruction for the solution with Base URL Element ... Prerequisites: This guide assumes that you build your app using create-react-app , use ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the reproduction. It’s an issue with Nitro following the links with
/sub
prefixed. (Not an issue withuseRoute()
.) PR incoming.useRoute().path
should not include the baseURL - if it does that’s a bug that needs to be addressed.See: https://stackblitz.com/edit/github-vrnb5v