Closed Salimify closed 1 year ago
Might need to add Quasar related things in vite.optimizeDeps.exclude
or vite.ssr.noExternal
. Can you share the code using https://vitepress.new, it'll be easier for us to quickly test things there.
Might need to add Quasar related things in
vite.optimizeDeps.exclude
orvite.ssr.noExternal
. Can you share the code using https://vitepress.new, it'll be easier for us to quickly test things there.
@brc-dd Issue reproduced on stackblitz , everything seems to be working fine when running vitepress dev docs
, but it still breaks when running vitepress build docs
.
Both vite.optimizeDeps.exclude
and vite.ssr.noExternal
did not help.
Hey, tbh I have never used Quasar. So, are there any docs where they mention their vue plugin? My guess is it should have some special handling for SSR.
Okay, so I searched other issues on Quasar and found someone using it with VitePress (https://github.com/quasarframework/quasar/issues/15211). Here is what they are doing:
app.use(Quasar, {}, { req: { headers: {} } });
https://stackblitz.com/edit/vite-acj5cz
It needs a third parameter called ssrContext
({ req: { headers: {} } }
in this case). I can find it being referenced in Quasar's source code but I don't fully understand how it's working.
Edit: ah it looks like they are using the ssrContext
for getting the user-agent from req headers and setting some cookies via response header, which might make sense in case of SSR but are safe to ignore in case of SSG (vitepress).
If you don't want to put that extra req
thing there, consider creating a issue at Quasar's GitHub repo asking them to use optional chaining while accessing values from ssrContext
.
Describe the bug
While trying to run document some components built on top of Quasar components, I was unable to run
vitepress build docs
for my project and throwing errorReproduction
config.ts
index.ts
Expected behavior
As
vitepress dev docs
works fine and serving the documentation with the required component example, running 'vitepress build docs' is not running fine in rendering pages step.System Info
Additional context
No response
Validations