#8305·humhub

Replace the intl-messageformat browser build and keep the socket.io-client pin (both upstream artifacts are permanently unusable)

Author: luke-Created Jul 15, 2026Updated Sep 19, 2026
LabelsKind:EnhancementPrio:LowModule:Core

Background

#8303 pinned two npm-asset packages to exact versions because the newer releases on the asset-packagist mirror ship unusable build artifacts:

  • npm-asset/intl-messageformat pinned to 11.1.2 — the shipped intl-messageformat.iife.js is not an IIFE but an ES module with a top-level export statement. Since IntlMessageFormatAsset is part of AppAsset::STATIC_DEPENDS, the export ends up inside the combined resources/js/humhub-app.js and the whole head bundle fails with Uncaught SyntaxError: Unexpected token 'export' — jQuery and everything else never execute (this is what turned CI on develop/next red on 2026-07-15).
  • npm-asset/socket.io-client pinned to 2.5.0 — the 2.5.1 package does not contain the dist/ directory, but SocketIoAsset references dist/socket.io.slim.js (breaks live push).

This issue originally tracked lifting those pins once upstream ships usable artifacts again.

Findings (2026-09-19)

Neither pin can be lifted by waiting. In both cases the assumption behind this issue — a temporary upstream regression that will be fixed — turned out to be wrong.

intl-messageformat: upstream is permanently ESM-only

Checked the tarballs straight from the npm registry:

Version intl-messageformat.iife.js
11.1.2 (current pin), 11.1.3 real IIFE (var IntlMessageFormat = (() => {)
11.1.4 never published
11.2.0 real IIFE
11.2.1 … 11.2.15, 12.0.x … 12.1.1 (latest) ES module with top-level export { … }

So the breakage started with 11.2.1, not 11.2.10 — 11.2.10 was merely the version composer update happened to resolve to at the time. The current latest (12.1.1) is affected identically; the file is byte-for-byte the same shape.

This is not a build glitch: package.json of 12.1.1 declares "type": "module" with "exports": { ".": "./index.js" } and ships no browser bundle at all. The .iife.js filename is a leftover of the old pipeline; the content is plain rolldown ESM output.

Upstream has no intention of restoring UMD/IIFE builds — formatjs/formatjs#3188 (react-intl.iife.js is broken) and formatjs/formatjs#3462 (Request to bring back UMD builds) were both closed by the stale bot without a fix. There is not even an open report for the mislabelled intl-messageformat.iife.js.

Consequence: relaxing the constraint to ^11.1 or ^12 will never be safe. The only usable published versions are 11.1.2, 11.1.3 and 11.2.0, so a widened range buys nothing.

Upside for a proper fix: the only ESM syntax in the file is a single trailing export (line 2808 of 2809) — no import, nothing else. Bundling the package ourselves with esbuild --format=iife --global-name=IntlMessageFormat from @npm/intl-messageformat/index.js produces exactly the artifact 11.1.2 used to provide, and would let the pin be dropped entirely.

socket.io-client: 2.5.1 is not an npm release at all

The "missing dist/" is a symptom; the cause is different from what was assumed:

  • npm has no 2.5.1. registry.npmjs.org/socket.io-client/2.5.1 returns 404, the v2-latest dist-tag still points at 2.5.0 (2022-06-26), and socketio/socket.io-client has no 2.5.1 tag (its 2.x branch is still at version 2.5.0).
  • A throwaway composer require npm-asset/socket.io-client:^2.5 against asset-packagist nevertheless installs 2.5.1, from: https://api.github.com/repos/socketio/socket.io/zipball/88b2cdb6abd38d6466fa4360748f2f67d8837ad4

That is a source zipball of the socket.io monorepo, not an npm tarball. It contains lib/, test/, examples/ — dist/ is generated at publish time and simply does not exist in the repository. The entry will therefore never become usable, and ^2.5 stays permanently broken.

The pin on 2.5.0 is thus not a workaround but the normal state for as long as we stay on socket.io-client 2.x.

Upgrading the client alone is not possible: humhub/humhub-pushservice runs socket.io: ^2.0.4 (unchanged since 2017 apart from a docs-link commit), and the v2 and v4 wire protocols are incompatible — client, service and every existing deployment would have to move together. Given that MercurePushDriver (#7831, since 1.18) already provides a maintained alternative, phasing out the socket.io push driver looks more sensible than a 4.x upgrade.

CI guard

Still absent. .github/workflows/php-test-base.yml runs grunt build-assets and never inspects the result, so this class of breakage only surfaces in the acceptance tests as $ is not defined.

The current build is healthy: assets/*/js/humhub-app.js starts with the jQuery IIFE and contains no top-level export.

Tasks

  • intl-messageformat: add an esbuild --format=iife --global-name=IntlMessageFormat step to grunt build-assets, point IntlMessageFormatAsset at the self-built artifact and relax the composer.json constraint to ^12. Optionally file an upstream bug for the mislabelled intl-messageformat.iife.js.
  • socket.io-client: document the 2.5.0 pin as permanent (comment in composer.json) and track deprecating the socket.io push driver in favour of Mercure separately.
  • Add a CI guard: grep the built bundles for top-level export/import after grunt build-assets.

Verification (for whoever picks this up)

The CI build does not catch this class of breakage — grunt build-assets and uglify pass happily with an ESM file in the bundle, and only the acceptance tests fail afterwards ($ is not defined). After changing anything here, verify locally:

  1. grunt build-assets
  2. resources/js/humhub-app.js must start with the jQuery IIFE and contain no top-level export
  3. Load the bundle in a browser as a classic <script> and check window.jQuery is defined (note: node --check is not sufficient — Node ≥ 20.19 auto-detects ESM syntax and reports no error)