quasarframework/quasar · warning

The file defined in bex manifest > background > service_work

Error message

The file defined in bex manifest > background > service_worker > "${rawName}" does NOT exist. Skipping.

What it means

extractBexScripts maps the manifest's background.service_worker entry to a compiled output script. It resolves the raw name against the src-bex directory; if that input file does not exist on disk, it warns and skips the entry, leaving the service worker out of the build.

Source

Thrown at app-vite/lib/modes/bex/bex-utils.js:117

  }
}

const scriptExtRE = /\.[jt]sx?$/i

function extractBexScripts(quasarConf, bexManifest) {
  const scriptList = []
  const scriptNameSet = new Set()

  if (bexManifest.background?.service_worker) {
    const rawName = bexManifest.background.service_worker
    const scriptName = rawName.replace(scriptExtRE, '')
    const inputFile = quasarConf.ctx.appPaths.resolve.bex(rawName)

    bexManifest.background.service_worker = scriptName + '.js'

    if (!fse.existsSync(inputFile)) {
      warn()
      warn(
        `The file defined in bex manifest > background > service_worker > "${rawName}" does NOT exist. Skipping.`
      )
      warn()
    } else {
      const entry = getCompilationEntry(quasarConf, inputFile, scriptName)
      if (!scriptNameSet.has(entry.name)) {
        scriptNameSet.add(entry.name)
        scriptList.push(entry)
      }
    }
  }

  bexManifest.background?.scripts?.forEach((rawName, index) => {
    const scriptName = rawName.replace(scriptExtRE, '')
    const inputFile = quasarConf.ctx.appPaths.resolve.bex(rawName)

    bexManifest.background.scripts[index] = scriptName + '.js'

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Create the missing file at the referenced path inside src-bex (e.g. src-bex/my-background.js).
  2. Correct the background.service_worker path in src-bex/manifest.json to match an existing file.
  3. Check filename casing exactly matches the manifest entry (Linux case sensitivity).
  4. If the service worker is no longer needed, remove the background.service_worker field from the manifest.

Example fix

// before (src-bex/manifest.json)
"background": { "service_worker": "backgroud.js" }
// after
"background": { "service_worker": "background.js" } // file exists at src-bex/background.js
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs'), path = require('path')
const m = require('./src-bex/manifest.json')
const sw = m.all?.background?.service_worker
if (sw && !fs.existsSync(path.join('src-bex', sw))) {
  throw new Error(`background.service_worker points to missing file: src-bex/${sw}`)
}

Prevention

When it happens

Trigger: manifest background.service_worker references a file (e.g. "my-background.js") that is not present in src-bex (resolve.bex(rawName) fails fse.existsSync); the script is skipped instead of being added as a compilation entry.

Common situations: Background file renamed or deleted but manifest not updated; wrong path (missing leading folder like "background/index.js"); file placed outside src-bex; case-sensitive filesystem mismatch (Linux CI vs local Windows/macOS).

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/4abc072296a5d2a4. Report an issue: GitHub.