Prerendering doesn't respect `baseURL`
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.14.2
- Nuxt Version:
3.0.0-rc.1
- Package Manager:
npm@8.5.0
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
npx nuxi init nuxt-app
cd nuxt-app
npm install
NUXT_APP_BASE_URL=/foo npm run generate
Describe the bug
When NUXT_APP_BASE_URL is specified, the deployed file does not have index.html
not specify NUXT_APP_BASE_URL
> npm run generate
> tree ./.output/public
├── _nuxt
│ ├── entry-79c674ce.mjs
│ ├── entry.93eb12fa.css
│ └── manifest.json
└── index.html
1 directory, 4 files
specify NUXT_APP_BASE_URL
> NUXT_APP_BASE_URL=/foo npm run generate
> tree ./.output/public
.
└── _nuxt
├── entry-79c674ce.mjs
├── entry.93eb12fa.css
└── manifest.json
1 directory, 3 files
missing index.html 😦
Additional context
No response
Logs
> generate
> nuxt generate
Nuxt CLI v3.0.0-rc.1 16:21:28
ℹ Vite client warmed up in 1652ms 16:21:34
ℹ Client built in 1674ms 16:21:34
ℹ Building server... 16:21:34
✔ Server built in 563ms 16:21:34
✔ Generated public .output/public nitro 16:21:34
ℹ Initializing prerenderer nitro 16:21:34
ℹ Prerendering 1 initial routes with crawler nitro 16:21:37
├─ / (47ms) (Error: [404] Not Found) nitro 16:21:37
✔ You can now deploy .output/public to any static hosting! 16:21:37
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Prerendering doesn't respect config.app.baseURL #4732
When using nuxt generate the prerenderer doesn't respect the baseURL . It will return a 404 for the default routes.
Read more >99170 - config.baseURL and <base> tag functionality
baseURL has been deprecated. The option allowed to set a fixed URL which was then added as <base> tag to the HTML <head>...
Read more >General tips and best practices - Troubleshooting - Prerender.io
The Prerender.io service fetches your site using the Prerender.io user agent, but it only renders, caches and stores the DOM, it doesn't ......
Read more >Visual Studio Typescript Intellisense doesn't respect tsconfig ...
However, my intellisense shows errors for any imports using a path based on the baseUrl configured in my tsconfig.json.
Read more >Running a Next.js Site on Cloudflare Pages - Opstrace
js static HTML export to prerender all pages to plain html. Given we don't use any server-side rendering capabilities at the moment, this...
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
The prerender with
{crawlLinks: true}
doesn’t support baseURL. It will generate baseURL folder in output files.This should be resolved in nitropack v0.4.3. which you can get with
yarn upgrade nuxt
ornpm upgrade nuxt
.Let me know if not and I’ll reopen.