Fixed the window ci problem#47680
Conversation
|
I have tested this item ✅ successfully on 3f33579 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47680. |
| format: targetPath.endsWith('core.js') ? 'iife' : 'es', | ||
| sourcemap: false, | ||
| file: targetPath, | ||
| inlineDynamicImports: true, |
There was a problem hiding this comment.
This does not looks like related to the issue. Explain
There was a problem hiding this comment.
Thanks for pointing this out.
While working on the Windows ESM issue, I encountered an additional failure in the Codemirror build step:
RollupError: Invalid value for option "output.file"
This happens because Codemirror uses dynamic imports, which causes Rollup to generate multiple chunks. In that case, using output.file is invalid unless inlineDynamicImports is enabled or output.dir is used.
To keep the existing single-file output behavior consistent, I added inlineDynamicImports: true.
However, I understand this is not directly related to the original ESM issue. I can remove this change and keep the PR focused if preferred.
There was a problem hiding this comment.
I am always concerned when the same post is made by a completely different person. The first version of this comment was made by @devesht-ML - github emails all comments - even if they are subsequently deleted
There was a problem hiding this comment.
yes this came because i am working with team so unfortunately that person does this reply.
I was sorry for this behaviour and fault.
There was a problem hiding this comment.
I do not like this change, but I cannot currently check.
@dgrammatiko can you please have an eye? Whether it does not break final result
There was a problem hiding this comment.
The other changes with the path/url are fine, this line NO!
There was a problem hiding this comment.
@dgrammatiko Do i have to remove this [inlineDynamicImports: true,] part.
There was a problem hiding this comment.
@Fedik @dgrammatiko
Hello, I have tested the fix with and without that line.
The path/URL changes fixes ERR_UNSUPPORTED_ESM_URL_SCHEME.
The inlineDynamicImports: true line fixes another error:
npm error code 1 npm error path D:\(my path to joomla project)\joomla-cms 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:\(my path to the local)\Local\npm-cache\_logs\2026-04-25T20_19_31_521Z-debug-0.log
When I removed that line, I saw the error.
I see that you have agreed on the URL/Path solution. I tested it on windows, I don't know about other OSs.
If you think that the line inlineDynamicImports: true is a wrong fix to the error I mentioned above, then I suggest keeping the fix of ERR_UNSUPPORTED_ESM_URL_SCHEME in this PR, removing inlineDynamicImports: true and opening another issue with the other error requiring a proper fix.
In summary: there is now 2 separated errors, one documented in an issue and another one isn't.
There was a problem hiding this comment.
Hi @pratibha-builds, I see that the maintainers asked for a detailed explanation of the line. It would be helpful if you can explain how this line solves the problem and if it's safe. You can also answer on their concern about if this is true: This will probably undo the whole concept of importmaps.
This will help, thanks.
There was a problem hiding this comment.
Thanks for the feedback and review.
I tested the changes on Windows and observed two separate issues:
-
The original issue:
ERR_UNSUPPORTED_ESM_URL_SCHEME
→ This is resolved by converting paths using pathToFileURL(), and works as expected. -
A separate issue in the Codemirror build:
RollupError: Invalid value for option "output.file"
I initially added inlineDynamicImports: true because it allows Rollup to inline dynamic imports and avoid the multi-chunk error. However, I understand this changes bundling behavior and may interfere with importmaps, as mentioned.
To keep this PR focused and safe, I have removed the inlineDynamicImports change.
The Rollup issue appears to be unrelated and likely needs a separate discussion or fix (e.g. using output.dir or adjusting module handling properly).
Please let me know if you would like me to open a separate issue for that.
49856b7 to
5280843
Compare
Pull Request resolves #47679
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:
were passed directly into dynamic
import()calls. Node.js ESM loader requires valid URLs (file://scheme), which caused the error:To resolve this:
All dynamic imports using file paths are converted using:
Paths are normalized using
path.resolve()Fixed JSON module import in TinyMCE builder
Updated Rollup config in Codemirror builder using
inlineDynamicImports: trueto avoid multi-chunk output errorsThis ensures the build works correctly on Windows systems.
Testing Instructions
6.2-devbranchActual result BEFORE applying this Pull Request
npm installfails during buildScreenshot (Before Fix)
Expected result AFTER applying this Pull Request
npm installcompletes successfullyScreenshot (After Fix)
Additional Context
While testing, it was observed that running:
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 development docs:
https://developer.joomla.org/
Node.js ESM documentation (import specifiers):
https://nodejs.org/api/esm.html#urls
Rollup output configuration:
https://rollupjs.org/configuration-options/#output-inlineDynamicImports
No documentation changes for guide.joomla.org needed
No documentation changes for manual.joomla.org needed