Skip to content

Fixed the window ci problem#47680

Merged
MacJoom merged 3 commits into
joomla:6.2-devfrom
pratibha-builds:fix-esm-windows
May 6, 2026
Merged

Fixed the window ci problem#47680
MacJoom merged 3 commits into
joomla:6.2-devfrom
pratibha-builds:fix-esm-windows

Conversation

@pratibha-builds

@pratibha-builds pratibha-builds commented Apr 24, 2026

Copy link
Copy Markdown

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:

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.2-dev labels Apr 24, 2026
@CSGoat0

CSGoat0 commented Apr 24, 2026

Copy link
Copy Markdown
Member

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.

Comment thread build/build-modules-js/javascript/js-handle.mjs Outdated
@brianteeman

Copy link
Copy Markdown
Contributor

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

@CSGoat0

CSGoat0 commented May 6, 2026

Copy link
Copy Markdown
Member

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 ☹️

@MacJoom MacJoom merged commit 3c7a905 into joomla:6.2-dev May 6, 2026
52 checks passed
@MacJoom

MacJoom commented May 6, 2026

Copy link
Copy Markdown
Contributor

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

@chmst

chmst commented May 11, 2026

Copy link
Copy Markdown
Contributor

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

@brianteeman

Copy link
Copy Markdown
Contributor

@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

@chmst

chmst commented May 11, 2026

Copy link
Copy Markdown
Contributor

@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

@brianteeman

Copy link
Copy Markdown
Contributor

@chmst yes that was identified here but ignored.

@brianteeman brianteeman mentioned this pull request May 16, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.2-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants