Skip to content

Using noExternal in quasar.config.ts breaks SSR server #18053

@rtcpw

Description

@rtcpw

What happened?

Use noExternal in quasar.config.ts for Quasar SSR SPA app:

extendViteConf(viteConf) {
  viteConf.ssr = {
    noExternal: ['some-random-package-that-should-not-even-exist'],
  };
},

The compiled server-entry.js suddenly has this extra import in it:

import{defineStore as E,defineRouter as H}from"@quasar/app-vite/wrappers";

This dependency is not specified in the server package.json, and thus the server fails to execute (throws an exception due to the missing dependency).

What did you expect to happen?

I expect to have the ability to configure noExternal in quasar.config.ts and have it not break SSR server.

Reproduction URL

https://stackblitz.com/edit/quasarframework-stackblitz-templates-nahx84xj?file=quasar.config.js

How to reproduce?

  1. Go to the provided reproduction link
  2. Stop the process running in the terminal after all the installs complete
  3. Execute quasar build --mode ssr --publish
  4. Run rm node_modules -r (to simulate a deployed setup)
  5. Run cd dist/ssr
  6. Run npm install
  7. Run npm start and observe ERR_MODULE_NOT_FOUND error referencing @quasar/app-vite
  8. Investigate /dist/ssr/server/server-entry.js and observe the presence of import{defineRouter as A}from"@quasar/app-vite/wrappers";

Flavour

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

Areas

SSR Mode

Platforms/Browsers

Other

Quasar info output

Operating System - Windows_NT(10.0.26100) - win32/arm64
NodeJs - 22.16.0

Global packages
  NPM - 11.4.2
  yarn - Not installed
  pnpm - Not installed
  bun - Not installed
  @quasar/cli - 2.5.0
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.18.1 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 2.2.1 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.17.0 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.5.17 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.5.1
  pinia - 3.0.3 -- Intuitive, type safe and flexible Store for Vue
  vite - 6.3.5 -- Native-ESM powered web dev build tool
  vite-plugin-checker - Not installed
  eslint - 9.29.0 -- An AST-based pattern checker for JavaScript.
  esbuild - 0.25.5 -- An extremely fast JavaScript and CSS bundler and minifier.
  typescript - 5.5.4 -- 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
  @quasar/quasar-app-extension-apollo - 2.2.4 -- A Quasar app extension to add GraphQL support using Apollo Client.

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions