You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug $q.screen.width always returns 0 on quasar dev -m ssr and running the build app from quasar build -m ssr. This also broke $q.screen.gt (always return false) and $q.screen.lt (always return true). $q.screen.width on SPA mode (quasar dev) returns the correct value.
SuspiciousLookingOwl
changed the title
$q.screen.width is always 0 in SSR mode
$q.screen.width and $q.screen.height is always 0 in SSR mode
Apr 16, 2021
there is little to nothing what we can do here. but I'll try to show some alternatives.
1 - don't use the Screen Plugin and use a CSS based solution (media queries) 2 - use client hints as a fallback on the server side, but remember, that had some caveats, so isn't bulletproof:
It will not work in the first call
will not handle the height
requires SSL (u'll need a valid HTTPS certificate)
the browser will cache that value, so if u resize the page than refresh, u'll get a old value (probably).
Fix will be available next week in Quasar v2.0.0-beta.13 AND "@quasar/app" v3.0.0-beta.16 (needs both).
It will also contain the promised Webpack 5 upgrade.
Describe the bug
$q.screen.width
always returns 0 onquasar dev -m ssr
and running the build app fromquasar build -m ssr
. This also broke$q.screen.gt
(always returnfalse
) and$q.screen.lt
(always returntrue
).$q.screen.width
on SPA mode (quasar dev
) returns the correct value.Codepen/jsFiddle/Codesandbox (required)
https://codesandbox.io/s/quiet-smoke-vn1k1
npm run start:ssr
(npm run start
for SPA mode to ensure that it works properly)To Reproduce
Steps to reproduce the behavior:
quasar create app-name --branch next
)quasar dev -m ssr
){{ $q.screen.width }}
to the component0
Expected behavior
$q.screen.width
should return the width sizePlatform (please complete the following information):
Quasar Version:
^2.0.0-beta.1
@quasar/app Version:
^3.0.0-beta.1
Quasar mode:
Tested on:
OS: Windows 10
Node: 14.15.3
NPM: 6.14.9
Yarn: -
Browsers: Microsoft Edge 89.0.774.76, Firefox 86.0.1
iOS: -
Android: -
Electron: -
Additional context
quasar
version^1.0.0
and@quasar/app
version^2.0.0
(fromquasar create app-name
)The text was updated successfully, but these errors were encountered: