NPM Resource Changed bug PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar pratibha-builds
pratibha-builds
24 Apr 2026

Fixes #47679

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

Summary of Changes

This PR fixes a Windows-specific issue in the Joomla build process where npm install / asset build fails due to invalid ESM import paths.

On Windows, absolute file paths like:

C:\Users\...

were passed directly into dynamic import() calls. Node.js ESM loader requires valid URLs (file:// scheme), which caused the error:

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]

To resolve this:

  • All dynamic imports using file paths are converted using:

    pathToFileURL(resolvedPath).href
  • Paths are normalized using path.resolve()

  • Fixed JSON module import in TinyMCE builder

  • Updated Rollup config in Codemirror builder using inlineDynamicImports: true to avoid multi-chunk output errors

This ensures the build works correctly on Windows systems.


Testing Instructions

  1. Clone Joomla repository on Windows
  2. Switch to 6.2-dev branch
  3. Run:
npm install

Actual result BEFORE applying this Pull Request

  • npm install fails during build
  • Error:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]
  • In some cases:
RollupError: Invalid value for option "output.file"

Screenshot (Before Fix)

cli_error_fix

Expected result AFTER applying this Pull Request

  • npm install completes successfully
  • All build steps execute without errors
  • Joomla assets are generated correctly

Screenshot (After Fix)

image

Additional Context

While testing, it was observed that running:

composer install

may fail if required PHP extensions (gd, sodium, ldap and zip) are missing.
This is an environment setup issue and not related to this bug, but it may affect contributors during setup.


Link to documentations

Relevant references:

avatar pratibha-builds pratibha-builds - open - 24 Apr 2026
avatar pratibha-builds pratibha-builds - change - 24 Apr 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Apr 2026
Category JavaScript Repository NPM Change
avatar CSGoat0 CSGoat0 - test_item - 24 Apr 2026 - Tested successfully
avatar CSGoat0
CSGoat0 - comment - 24 Apr 2026

I have tested this item ✅ successfully on 3f33579

This works.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47680.

avatar CSGoat0
CSGoat0 - comment - 24 Apr 2026

I have tested this item ✅ successfully on 3f33579

This works.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47680.

avatar pratibha-builds pratibha-builds - change - 25 Apr 2026
Labels Added: NPM Resource Changed PR-6.2-dev
avatar pratibha-builds pratibha-builds - change - 27 Apr 2026
The description was changed
avatar pratibha-builds pratibha-builds - edited - 27 Apr 2026
avatar MacJoom MacJoom - change - 4 May 2026
Labels Added: bug
avatar brianteeman
brianteeman - comment - 6 May 2026

what is the status with this pr. there are a lot of npm updates to do for 6.2 which I would have happily done but its not possible until this issue is resolved

avatar CSGoat0
CSGoat0 - comment - 6 May 2026

what is the status with this pr. there are a lot of npm updates to do for 6.2 which I would have happily done but its not possible until this issue is resolved

Unfortunately this PR alone doesn't solve the whole thing. There's another issue that needs to be solved even after applying this one.

I have applied this pr on my local + inlineDynamicImports line (temporarily) today just to be able to run npm ci â˜šī¸

avatar MacJoom MacJoom - change - 6 May 2026
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-05-06 17:48:23
Closed_By MacJoom
avatar MacJoom MacJoom - close - 6 May 2026
avatar MacJoom MacJoom - merge - 6 May 2026
avatar MacJoom
MacJoom - comment - 6 May 2026

Thanks for all your hard work!

avatar MacJoom
MacJoom - comment - 6 May 2026

Thanks for all your hard work! More to come i hope

avatar chmst
chmst - comment - 11 May 2026

Doesn't work for me. Same error as in #47679

avatar brianteeman
brianteeman - comment - 11 May 2026

@chmst are you sure its the same error. For me the error was fixed but a new error was exposed. the same error that this PR explicitly stated was not fixed. This should not have been merged and marked as fixed as it was incomplete. I created a new issue #47755

avatar chmst
chmst - comment - 11 May 2026

@brianteeman - indeed, it is another error

Failed Task [plg_editors_codemirror::js]
Trace: Error: Processing failed for "D:\laragon\www\joomla-62dev\media_source\plg_editors_codemirror\js\codemirror.es6.js".
at file:///D:/laragon/www/joomla-62dev/build/build-modules-js/javascript/js-handle.mjs:157:11
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Promise.all (index 0)
at async CodemirrorModuleBuilder.js (file:///D:/laragon/www/joomla-62dev/media_source/plg_editors_codemirror/builder.mjs:119:5)
at async Promise.all (index 44) {
[cause]: Error [RollupError]: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.
at getRollupError (file:///D:/laragon/www/joomla-62dev/node_modules/rollup/dist/es/shared/parseAst.js:402:41)
at error (file:///D:/laragon/www/joomla-62dev/node_modules/rollup/dist/es/shared/parseAst.js:398:42)
at validateOptionsForMultiChunkOutput (file:///D:/laragon/www/joomla-62dev/node_modules/rollup/dist/es/shared/node-entry.js:20756:16)
at Bundle.generate (file:///D:/laragon/www/joomla-62dev/node_modules/rollup/dist/es/shared/node-entry.js:20609:17)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async file:///D:/laragon/www/joomla-62dev/node_modules/rollup/dist/es/shared/node-entry.js:23558:27
at async catchUnfinishedHookActions (file:///D:/laragon/www/joomla-62dev/node_modules/rollup/dist/es/shared/node-entry.js:22925:16)
at async Promise.all (index 0)
at async CodemirrorModuleBuilder.js (file:///D:/laragon/www/joomla-62dev/media_source/plg_editors_codemirror/builder.mjs:119:5)
at async Promise.all (index 44) {
code: 'INVALID_OPTION',
url: 'https://rollupjs.org/configuration-options/#output-dir'
}
}
at file:///D:/laragon/www/joomla-62dev/build/build-modules-js/builder/builder-factory.mjs:74:21
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Promise.all (index 44)
Processing failed for "D:\laragon\www\joomla-62dev\media_source\plg_editors_codemirror\js\codemirror.es6.js".
npm error code 1
npm error path D:\laragon\www\joomla-62dev
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node --env-file=./build/production.env build/build.mjs build -a
npm error A complete log of this run can be found in: C:\Users\konta\AppData\Local\npm-cache_logs\2026-05-11T07_47_57_768Z-debug-0.log

avatar brianteeman
brianteeman - comment - 11 May 2026

@chmst yes that was identified here but ignored.

Add a Comment

Login with GitHub to post a comment