Skip to content

fix: load shared webpack chunks before main/settings entries#37

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/webpack-shared-chunks-load
May 13, 2026
Merged

fix: load shared webpack chunks before main/settings entries#37
rubenvdlinde merged 1 commit into
developmentfrom
fix/webpack-shared-chunks-load

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

What

webpack.config.js uses splitChunks with enforce: true cacheGroups that emit two shared chunks (<appId>-shared-vendor, <appId>-shared-nc-vue). The main and adminSettings entry bundles wrap their Vue mount in __webpack_require__.O(0, [shared chunks], …), which only fires once every listed chunk has registered itself on self.webpackChunk<appId>. With only the entry script in addScript(), the shared chunks never load, the mount callback never fires, and the app silently renders nothing inside the existing #content wrapper.

Why this matters

This is the scaffold template — every newly-generated app inherits the bug. The fleet-wide audit caught this on zaakafhandelapp#206; nat has the same splitChunks + enforce: true pattern but never updated its templates/index.php / templates/settings/admin.php to match.

lib/Dashboard/ExampleWidget.php already loaded the shared chunks correctly; this PR brings the page and admin-settings templates into line.

How

Register every chunk produced by splitChunks in dependency order before the entry script. Mirrors the canonical fix in zaakafhandelapp#206.

…Vue-mount failure)

webpack.config.js uses splitChunks with `enforce: true` cacheGroups that
emit two shared chunks (`<appId>-shared-vendor`,
`<appId>-shared-nc-vue`). The main and adminSettings entry bundles wrap
their Vue mount in `__webpack_require__.O(0, [shared chunks], …)`, which
only fires once every listed chunk has registered itself on
`self.webpackChunk<appId>`. With only the entry script in
`addScript()`, the shared chunks never load, the mount callback never
fires, and the app silently renders nothing.

Mirrors the canonical fix in zaakafhandelapp#206. ExampleWidget.php
already loaded the shared chunks correctly; this brings the page and
admin-settings templates into line.

Because this is the scaffold template, every newly-generated app
inherits the fix.
@rubenvdlinde rubenvdlinde merged commit 20d02c5 into development May 13, 2026
17 checks passed
@rubenvdlinde rubenvdlinde deleted the fix/webpack-shared-chunks-load branch May 13, 2026 09:13
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ 75266a4

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 428/428
PHPUnit
Newman
Playwright ⏭️

Coverage: 0% (0/3 statements)


Quality workflow — 2026-05-13 09:22 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant