T
TanStack2mo ago
genetic-orange

Nitro v2 plugin causing _shell.html to not build in spa mode

Hi there, I'm having issues with SPA mode then using the Nitro plugin. When the plugin is enabled, no _shell.html file is generated, but disabling it _shell.html is generated as expected. I have put up an example repo here, the base is generated from npm create @tanstack/start@latest https://github.com/clawrence121/tss-spa-mode-not-rendering-shell This is using start and router versions 1.132.51 and NPM.
GitHub
GitHub - clawrence121/tss-spa-mode-not-rendering-shell
Contribute to clawrence121/tss-spa-mode-not-rendering-shell development by creating an account on GitHub.
11 Replies
correct-apricot
correct-apricot2mo ago
can you please create a github issue for this so we can properly track this? also, did you try nitro3?
genetic-orange
genetic-orangeOP2mo ago
I can! I tried nitro 3 and it wouldn't build at all, I'll include in the GH issue Thanks @Manuel Schiller here's the gh issue https://github.com/TanStack/router/issues/5426 I was able to get nitro v3 building, but same issue as v2
correct-apricot
correct-apricot2mo ago
k
deep-jade
deep-jade2mo ago
@c.lawrence121 Have you tried enabling prerendering? That’s what worked for me
genetic-orange
genetic-orangeOP2mo ago
@DaddyImPregnant I did but it didn't do anything, can I see the exact settings you have?
gradual-turquoise
gradual-turquoise5w ago
Thanks for posting this. I'm experiencing the same issue
correct-apricot
correct-apricot5w ago
gradual-turquoise
gradual-turquoise5w ago
Is there a nitro v3 plugin or do you just set a resolution for v3? Doing the same as what @c.lawrence121 has in his example:
// package.json
"nitro": "3.0.1-alpha.0",
// package.json
"nitro": "3.0.1-alpha.0",
and with the following in my vite config it doesn't prerender
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tanstackStart({
client: {
entry: "client.tsx",
},
server: {
entry: "server.ts",
},
spa: {
enabled: true,
// just prerender the /_shell/index.html page
prerender: {
enabled: true,
},
},
}),
nitroV2Plugin(),
viteReact(),
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tanstackStart({
client: {
entry: "client.tsx",
},
server: {
entry: "server.ts",
},
spa: {
enabled: true,
// just prerender the /_shell/index.html page
prerender: {
enabled: true,
},
},
}),
nitroV2Plugin(),
viteReact(),
When I comment out the nitroV2plugin it prerenders this is v1.133.35. I'll give it a go with v1.133.37 over the next week Just tried that with v1.133.37, still looks like the same issue on my end when testing with the above config
absent-sapphire
absent-sapphire5w ago
Your vite config does not use nitro v3 though. Import nitro v3 vite plugin from nitro/vite
gradual-turquoise
gradual-turquoise5w ago
Ohhhh I see. Do I still use the nitroV2Plugin from Tanstack?
absent-sapphire
absent-sapphire5w ago
Do I still use the nitroV2Plugin from Tanstack?
nope

Did you find this page helpful?