PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar tecpromotion
tecpromotion
21 Jun 2026

Pull Request resolves build error in PR #47994

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

The vendor CSS versioning step (build/build-modules-js/stylesheets/css-versioning.mjs) runs every CSS file in media/vendor through lightningcss, which fully parses and re-serialises the file in order to append cache-busting versions to url(...) references.

The problem: lightningcss does not just rewrite URLs, it semantically parses the whole stylesheet. As soon as a vendor package ships modern CSS syntax that the bundled lightningcss version cannot parse yet, the parser throws and the entire build aborts.

See PR #47994 from @brianteeman https://github.com/joomla/joomla-cms/actions/runs/27872556107/job/82563289058?pr=47994

This PR adds a non-destructive fallback:

  1. First try lightningcss as before.
  2. If parsing fails, do not abort the build.
  3. Instead, only url(...) values are versioned via a text-based rewrite, leaving the rest of the CSS — including any syntax the parser rejected — completely untouched.
  4. A log line indicates which file fell back, so the behaviour is transparent.

This is more robust long-term for vendor CSS (TinyMCE, Bootstrap, FontAwesome, …), since those packages can introduce new valid CSS syntax at any time.

Testing Instructions

  1. Add a CSS file under media/vendor/ that contains CSS syntax the bundled lightningcss cannot parse, together with at least one local url(...) reference, e.g.:
    .a..{color:red}
    .b{background:url(some-existing-asset.png)}
  2. (.a..{} is intentionally unparseable for lightningcss and stands in for not-yet-supported modern vendor syntax.)
  3. Run npm ci followed by npm run cssversioning (or the full php build/build.php).

Actual result BEFORE applying this Pull Request

The build aborts with an error such as:

Error: SyntaxError: Unexpected token Ident("of")
      at fixVersion (.../build-modules-js/stylesheets/css-versioning.mjs)

No CSS is versioned and the build fails.

Expected result AFTER applying this Pull Request

The build completes. The unparseable file logs a fallback notice (Could not parse … Falling back to text-based url() versioning.), its url(...) references receive a version query, and all other CSS — including the syntax lightningcss could not parse — is preserved byte-for-byte.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:
  • No documentation changes for guide.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed
avatar tecpromotion tecpromotion - open - 21 Jun 2026
avatar tecpromotion tecpromotion - change - 21 Jun 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jun 2026
Category JavaScript Repository
avatar HLeithner HLeithner - change - 22 Jun 2026
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-06-22 09:48:17
Closed_By HLeithner
Labels Added: PR-6.1-dev
avatar HLeithner HLeithner - close - 22 Jun 2026
avatar HLeithner HLeithner - merge - 22 Jun 2026
avatar CSGoat0 CSGoat0 - test_item - 22 Jun 2026 - Tested successfully
avatar CSGoat0
CSGoat0 - comment - 22 Jun 2026

I have tested this item ✅ successfully on 54e4a02

Tested with PR #47994 (TinyMCE update):

  1. PR #47994 alone → Build failed (error confirmed)
  2. Added this PR (#47996) on top → Build succeeded
  3. Version check: TinyMCE 8.6.0 confirmed
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47996.
avatar CSGoat0
CSGoat0 - comment - 22 Jun 2026

I have tested this item ✅ successfully on 54e4a02

Tested with PR #47994 (TinyMCE update):

  1. PR #47994 alone → Build failed (error confirmed)
  2. Added this PR (#47996) on top → Build succeeded
  3. Version check: TinyMCE 8.6.0 confirmed
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47996.
avatar brianteeman
brianteeman - comment - 22 Jun 2026

Thanks very much

Add a Comment

Login with GitHub to post a comment