fix(build): declare terser-webpack-plugin, restoring the production build - #142
Merged
Merged
Conversation
…uild
`release-stable` now gets past `npm ci` but fails the next step, `npm run build`:
[webpack-cli] Error: Cannot find module 'terser-webpack-plugin'
Require stack:
- node_modules/@nextcloud/webpack-vue-config/webpack.config.js
@nextcloud/webpack-vue-config requires terser-webpack-plugin without declaring
it, and had been getting away with it because webpack shipped it: webpack
5.105.4 listed "terser-webpack-plugin": "^5.3.17" in its own dependencies.
webpack 5.109.2 removed it, so the phantom disappeared and the require broke.
Our range is "webpack": "^5.94.0", so the previous lockfile regeneration moved
webpack 5.105.4 -> 5.109.2 in range and took terser-webpack-plugin with it.
Declaring terser-webpack-plugin directly fixes the actual defect -- we do use
it, through @nextcloud/webpack-vue-config's config -- and is version
independent, so a future in-range webpack bump cannot silently remove it again.
Pinning webpack back would restore the build but leave the undeclared
dependency in place to break on the next bump.
Verified locally: npm ci (npm 10) succeeds, `npm run build` compiles (0 errors,
2 pre-existing warnings), and `npm run lint` still passes with 0 errors.
Contributor
Quality Report — ConductionNL/doriath @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| composer | ✅ | ✅ 102/102 | |||
| npm | ✅ | ✅ 309/309 | |||
| PHPUnit | ❌ | ||||
| Newman | ❌ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-08-03 16:35 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #140. That PR fixed
npm ci;release-stablenow gets past it and fails on the next step,npm run build.Failure
Run 30831246003 —
npm cisucceeded (added 1197 packages), then:Cause
@nextcloud/webpack-vue-configrequire()sterser-webpack-pluginwithout declaring it. It got away with that because webpack used to ship it:dependencies5.105.4(previous lockfile)"terser-webpack-plugin": "^5.3.17"5.109.2(current lockfile)Our range is
"webpack": "^5.94.0", so regenerating the lockfile in #140 moved webpack5.105.4 → 5.109.2in range and the phantom dependency vanished with it.This was latent before #140 only because
npm cinever succeeded, sonpm run buildnever ran.Fix
Declare
terser-webpack-plugin: ^5.3.17as a devDependency.We genuinely use it — via
@nextcloud/webpack-vue-config's webpack config — so declaring it states a real dependency rather than working around one. It is also version-independent: a future in-range webpack bump cannot silently remove it again.Pinning
webpackback to5.105.4would restore the build too, but would leave the undeclared dependency in place to break on the next bump, and would freeze webpack for an unrelated reason.+1line inpackage.json,+62in the lockfile. Nothing else moves —@nextcloud/axiosstays2.5.2,@conduction/nextcloud-vuestays1.0.0-beta.101.Verification
npm ci(npm 10) — succeeds,added 1305 packagesnpm run build— exit 0,webpack 5.109.2 compiled with 2 warningsnpm run lint— exit 0, 0 errors (66 pre-existing@specjsdoc warnings)