LearnNewsExamplesServices
Frontmatter
id18833
titleProduction app worker build fails: webpack 5.111 needs minimizer 5.10+
stateClosed
labels
bugdependenciesairegressionbuild
assigneesneo-opus-ada
createdAtSep 18, 2026, 11:13 AM
updatedAtSep 18, 2026, 11:42 AM
githubUrlhttps://github.com/neomjs/neo/issues/18833
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 18, 2026, 11:28 AM

Production app worker build fails: webpack 5.111 needs minimizer 5.10+

Closed v13.2.0/archive-v13-2-0-chunk-21 bugdependenciesairegressionbuild
neo-opus-ada
neo-opus-ada commented on Sep 18, 2026, 11:13 AM

Context

Operator report, 2026-09-18: npm run build-all exits 1. The failing step is build-threads → dist/production → app worker:

ERROR in c2dbf450d3b9188847b7.html
c2dbf450d3b9188847b7.html from Terser plugin
`as` is not a supported option
DefaultsError: `as` is not a supported option
    at defaults (node_modules/terser/dist/bundle.min.js:78:15)
    ...
    at async renderEmbeddedSource (node_modules/minimizer-webpack-plugin/dist/minify.js:331:20)
    at async askEmbeddedRenderer (node_modules/webpack/lib/util/dataURL.js:231:18)

The Problem

  • Trigger: #18815 (Dependabot, 2026-09-17) bumped webpack 5.110.3 → 5.111.0 and left the transitive minimizer-webpack-plugin at 5.8.0 in package-lock.json.
  • webpack 5.111.0 offers each inline <script> body of an HTML asset to the embedded renderer with an as key: "script", "module" or "event-handler" (node_modules/webpack/lib/html/syntax.js, renderEmbeddedSource typedef).
  • minimizer-webpack-plugin 5.8.0 merges as into the terser options (dist/minify.js, renderEmbeddedSource), and terserMinify spreads those options into terser.minify (dist/utils.js, buildTerserOptions). Terser's option validation rejects the unknown key.
  • 5.10.0 is the first release whose buildTerserOptions takes as out of the options and maps it to module. webpack 5.111.0 declares "minimizer-webpack-plugin": "^5.7.0", so a lock that satisfies that range can still be one that 5.111.0 cannot work with.
  • Only the app worker build hits this, because its graph is the only one that emits an HTML asset with an inline script. apps/workstation/view/WorkspaceController.mjs openTopologyWorkspace() calls new URL('../index.html', import.meta.url) (since #18375), and apps/workstation/index.html has a classic inline <script>.

Reproducer. A minimal project outside the repo: the entry is new URL('./page.html', import.meta.url), the page has one classic inline <script>, and the build is mode: 'production', target: 'webworker', outputModule. Each row changes one variable:

webpack minimizer-webpack-plugin result
5.110.3 5.8.0 green
5.111.0 5.8.0 red: `as` is not a supported option
5.111.0 5.10.1 green, HTML output byte-identical to row 1

The Architectural Reality

  • No config in buildScripts/webpack/production/ sets optimization.minimizer, so production mode uses webpack's default minimizer (node_modules/webpack/lib/config/defaults.js, require("minimizer-webpack-plugin")). Because experiments.html defaults to "auto", that minimizer also minifies HTML assets and the scripts embedded in them.
  • No CI job builds neo's own production threads. The only job that runs webpack in production mode, consumer-runtime-build.yml's guard, did run on #18815 (package.json is in its paths) and passed. It compiles only the Data-worker and Main configs of a consumer fixture, never the app worker, and the app worker's graph is the only one with an inline-script HTML asset. That is why #18815 merged green. (Corrected 2026-09-18: this line first blamed the job's path filter, but the filter did not exclude #18815.)

The Fix

Refresh the transitive dependency in package-lock.json with npm update minimizer-webpack-plugin --package-lock-only, which resolves 5.10.1. The lock diff adds only four optional peerDependenciesMeta entries (@napi-rs/image, imagemin, sharp, svgo) and no new required dependency. No source or config change.

Acceptance Criteria

  • package-lock.json resolves node_modules/minimizer-webpack-plugin to ≥ 5.10.0, and no other package changes version.
  • On an install from the PR head's lock, npm run build-threads -- -n -e prod -t app exits 0. The same command on the pre-fix lock, at the same head, reproduces the as error.
  • npm run build-threads -- -n -e prod -t all exits 0 on the PR head.
  • Post-merge (operator): after npm install locally, npm run build-all exits 0.

Out of Scope

  • A CI observer for neo's production build on dependency PRs. This gap let #18815 merge green; adding one costs CI time on every dependency PR, so it is a separate decision.
  • Reporting upstream that webpack 5.111.0's ^5.7.0 range admits minimizer versions that cannot consume the as key it now sends.
  • Whether the Workstation popup URL resolves to a working page in dist/production. The bundle points new URL at dist/production/<hash>.html, which is the source index.html with <script src=../../src/MicroLoader.mjs>, a source-layout path. The runtime behaviour is unmeasured, and it is a separate question from this build break.

Avoided Traps

  • Reverting webpack to 5.110.3: discards a valid update, Dependabot proposes it again, and the stale transitive dependency stays.
  • optimization.minimizeOptions.html: false or experiments.html: false in the production configs: older webpack does not know these keys, and these configs also run in consumer workspaces (neoPath → node_modules/neo.mjs/) that bring their own webpack, which would fail schema validation. The change would also turn off HTML minification that worked before 5.111.
  • An npm overrides pin: the lock already pins what npm ci installs, and an override would add a second source of truth.
  • webpackIgnore on the new URL(): it would change what the popup URL means at runtime to fix a minifier version mismatch.

Related

  • #18815 (trigger) · #18375 (introduced the HTML asset reference)

Live latest-open sweep: checked the latest 20 open issues at 2026-09-18T09:11:20Z, and no equivalent was found. A2A in-flight sweep: no claim touches webpack, the minimizer or the lockfile. Memory Core sweep: no prior decision. Own-assigned sweep: no issue on the same surface.

Retrieval Hint: "webpack 5.111 minimizer-webpack-plugin as is not a supported option production app worker"

Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59

tobiu referenced in commit 7b19aa7 - "fix(deps): minimizer-webpack-plugin 5.10.1 reads what webpack 5.111 sends, so the production app worker builds (#18833) (#18834) on Sep 18, 2026, 11:28 AM
tobiu closed this issue on Sep 18, 2026, 11:28 AM
tobiu referenced in commit 3f859a4 - "Every PR to dev builds this repository's own dist (#18835) (#18836) on Sep 18, 2026, 11:56 AM