Skip to content

[Bug]: Hardcoded mdi-v6 import in bootstrap-icons.js breaks Vite SSR with @quasar/extras v2 + Express redirect error #18312

@bekaku

Description

@bekaku

What happened?

When running a Quasar Vite project in SSR mode with @quasar/extras v2.0.0, the dev server crashes with a Vite pre-transform error.

The issue occurs because quasar/icon-set/bootstrap-icons.js has a hardcoded import pointing to @quasar/extras/mdi-v6 (to borrow the subscript/superscript icons). Since @quasar/extras v2 dropped mdi-v6 in favor of mdi-v7, Vite fails to resolve this module.

Furthermore, when this Vite import analysis error occurs, the Quasar SSR dev webserver attempts to handle the error but incorrectly passes the file path as an HTTP status code to Express's res.redirect(), resulting in an ERR_HTTP_INVALID_STATUS_CODE crash, which masks the original Vite error.

What did you expect to happen?

  1. The bootstrap-icons.js should not hardcode mdi-v6 (perhaps update it to mdi-v7 or conditionally resolve it) so it remains compatible with @quasar/extras v2.
  2. The SSR error handler should correctly parse the Vite error without triggering an invalid status code in Express's res.redirect().

Reproduction URL

https://stackblitz.com/edit/quasarframework-stackblitz-templates-hk7rgfkb

How to reproduce?

  1. Create a Quasar project with @quasar/app-vit (v2.6.1) and quasar (v2.19.3).
  2. Install @quasar/extras v2 (e.g., ^2.0.0).
  3. Set the icon set to bootstrap-icons.
  4. Run the dev server in SSR mode: pnpm dev -m ssr (or quasar dev -m ssr).

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

SSR Mode

Platforms/Browsers

No response

Quasar info output

Operating System - Windows_NT(10.0.26220) - win32/x64
NodeJs - 24.14.1

Global packages
  NPM - 11.11.0
  yarn - Not installed
  pnpm - 11.5.1
  bun - Not installed
  @quasar/cli - 5.0.1
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.19.3 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 2.6.2 -- Quasar Framework App CLI with Vite
  @quasar/extras - 2.0.0 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.5.35 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 5.1.0
  pinia - 3.0.4 -- Intuitive, type safe and flexible Store for Vue
  vite - Not installed
  vite-plugin-checker - Not installed
  eslint - 10.4.1 -- An AST-based pattern checker for JavaScript.
  esbuild - Not installed
  typescript - 6.0.3 -- TypeScript is a language for application scale JavaScript development
  workbox-build - Not installed
  register-service-worker - Not installed
  electron - Not installed
  @electron/packager - Not installed
  electron-builder - Not installed
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Relevant log output

[vite] (client) Pre-transform error: Failed to resolve import "@quasar/extras/mdi-v6" from "node_modules/.q-cache/dev-ssr/vite-ssr-client/deps/quasar_icon-set_bootstrap-icons__js.js?v=e08d56b3". Does the file exist?
 Plugin: vite:import-analysis
 File: /projectRoot/node_modules/.q-cache/dev-ssr/vite-ssr-client/deps/quasar_icon-set_bootstrap-icons__js.js?v=e08d56b3:1:58
 1  |  import { mdiFormatSubscript, mdiFormatSuperscript } from "@quasar/extras/mdi-v6";
    |                                                           ^
 2  |  //#region node_modules/.pnpm/quasar@2.19.3/node_modules/quasar/icon-set/bootstrap-icons.js
 3  |  var bootstrap_icons_default = {

express deprecated res.redirect(url, status): Use res.redirect(status, url) instead file:\projectRoot\.quasar\dev-ssr\compiled-dev-webserver.js?t=1780480226807:166:19
node:_http_server:363
   throw new ERR_HTTP_INVALID_STATUS_CODE(originalStatusCode);
         ^

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: file:///projectRoot/node_modules/@quasar/extras/exports/mdi-v6
   at ServerResponse.writeHead (node:_http_server:363:11)
   at ServerResponse._implicitHeader (node:_http_server:349:8)
   at write_ (node:_http_outgoing:934:9)
   at ServerResponse.end (node:_http_outgoing:1051:5)
   at ServerResponse.redirect (projectRoot\node_modules\.pnpm\express@4.22.2\node_modules\express\lib\response.js:988:10)
   at <anonymous> (projectRoot\src-ssr\middlewares\render.ts:26:17) {
 code: 'ERR_HTTP_INVALID_STATUS_CODE'
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions