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
We have a server middleware to dynamically enable/disable SSR depending on the user agent.
In nuxt.config.ts we set ssr: true, our middleware then overrides this using
event.req.headers['x-nuxt-no-ssr'] = 'true';
if serving a user agent that should not get server side rendering.
This leads to problems when using assets in CSS files:
[nuxt] [request error] [unhandled] [500] globalThis.__buildAssetsURL is not a function
at ./.output/server/chunks/app/styles.mjs:7:276
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async renderInlineStyles (./.output/server/chunks/handlers/renderer.mjs:453:20)
at async ./.output/server/chunks/handlers/renderer.mjs:386:25
at async ./.output/server/chunks/handlers/renderer.mjs:30:22
at async ./.output/server/node_modules/h3/dist/index.mjs:592:19
at async Server.nodeHandler (./.output/server/node_modules/h3/dist/index.mjs:538:7)
Note that this only happens in production mode, dev mode is fine.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Linux
v14.19.3
3.0.0-rc.11
0.5.4
yarn@1.22.19
vite
ssr
,css
-
-
Reproduction
https://codesandbox.io/s/distracted-cookies-x37yoi?file=/assets/css/main.css
(Let me know if that link does not work for you)
Describe the bug
We have a server middleware to dynamically enable/disable SSR depending on the user agent.
In
nuxt.config.ts
we setssr: true
, our middleware then overrides this usingif serving a user agent that should not get server side rendering.
This leads to problems when using assets in CSS files:
Note that this only happens in production mode, dev mode is fine.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: