-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Description
I followed the official Quasar App Vite Upgrade Guide v2, and the upgrade process itself completed normally. The project also started successfully.
(Upgrade Guide: https://quasar.dev/quasar-cli-vite/upgrade-guide)
However, after opening the page in the browser, I hit an SSR template variable error.
In my /index.html, I originally had:
{{ someProp }}This worked in v1, but after upgrading to v2 it became undefined / not found.
Changing it to:
{{ ssrContext.someProp }}made it work again.
What I found
The current SSR docs still say that:
- you can set
ssrContext.someProp = 'some value'in a boot file - and then reference it in
/index.htmlas{{ someProp }}
(Configuring SSR: https://quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr/#boot-files)
But from the v2 source code, it looks like the render-template behavior has changed to:
variable: 'ssrContext'- and built-in interpolations were also changed from
{{ _meta.headTags }}to{{ ssrContext._meta.headTags }}
(Commit: 2e47188)
The @quasar/app-vite-v2.0.0-beta.1 release notes also mention:
perf(app-vite): SSR render-template in specific esm or cjs form, according to host project; interpolation by variable
(Release note: https://github.com/quasarframework/quasar/releases/tag/%40quasar%2Fapp-vite-v2.0.0-beta.1)
Question
In @quasar/app-vite v2, for user-defined SSR /index.html variables, should the correct syntax now be:
{{ ssrContext.someProp }}instead of the currently documented form:
{{ someProp }}If yes, should the documentation be updated?
Additional note
My current understanding is that this does not look like an incomplete local ESM migration issue, but rather a change in SSR template scope behavior in v2 while the docs example still reflects the old syntax.
If I am misunderstanding this, please let me know. Thanks.
Documentation Section URL
https://quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr/#boot-files
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)