PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar LadySolveig
LadySolveig
18 May 2026

Pull Request resolves #47755.
Follow-up of #47789

  • 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

This pull request addresses cross-platform path compatibility issues, particularly for Windows environments, by ensuring that module paths consistently use forward slashes in codemirror build.

Cross-platform path handling improvements:

  • Updated getPackagesUnderScope in resolve-package.mjs to use forward slashes when constructing module names, avoiding issues with backslashes on Windows that can break Rollup's external module matching.
  • Modified asset URI generation in builder.mjs to replace any backslashes with forward slashes, ensuring asset paths are valid in joomla.asset.json.

Testing Instructions

  • run npm ci

  • apply patch

  • run npm ci again

  • rename media folder to e. g. media_old

  • run npm ci again

Please check if the assets are loading correctly in the backend for the codemirror editor e. g. System -> Site Templates - Open any file. (ref: #47789 (comment))

Issues are currently occurring on Windows, to validate the test results, please specify the operating system on which the tests were executed. The fix for Windows should not cause regressions on other operating systems It would be helpful if we could validate this simultaneously here.

Actual result BEFORE applying this Pull Request

Error during execution on Windows - see #47755

Expected result AFTER applying this Pull Request

should work as expected without errors.

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

Thanks @joomdonation!

avatar LadySolveig LadySolveig - open - 18 May 2026
avatar LadySolveig LadySolveig - change - 18 May 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2026
Category JavaScript Repository
avatar LadySolveig LadySolveig - change - 18 May 2026
The description was changed
avatar LadySolveig LadySolveig - edited - 18 May 2026
avatar LadySolveig LadySolveig - change - 18 May 2026
The description was changed
avatar LadySolveig LadySolveig - edited - 18 May 2026
avatar LadySolveig LadySolveig - change - 18 May 2026
The description was changed
avatar LadySolveig LadySolveig - edited - 18 May 2026
avatar LadySolveig LadySolveig - change - 18 May 2026
The description was changed
avatar LadySolveig LadySolveig - edited - 18 May 2026
avatar LadySolveig LadySolveig - change - 18 May 2026
The description was changed
avatar LadySolveig LadySolveig - edited - 18 May 2026
avatar richard67 richard67 - change - 18 May 2026
Labels Added: PR-6.2-dev
avatar LadySolveig LadySolveig - change - 18 May 2026
The description was changed
avatar LadySolveig LadySolveig - edited - 18 May 2026
avatar Reda-Muhamed
Reda-Muhamed - comment - 19 May 2026

Tested successfully on Windows 11. The npm installation completed without errors (806 packages added, 807 audited).

avatar tecpromotion
tecpromotion - comment - 19 May 2026

Tested successfully on Windows 11. The npm installation completed without errors (806 packages added, 807 audited).

Please use "Test this" here: https://issues.joomla.org/tracker/joomla-cms/47793

avatar heelc29 heelc29 - test_item - 20 May 2026 - Tested successfully
avatar heelc29
heelc29 - comment - 20 May 2026

I have tested this item ✅ successfully on 439a4e6


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

avatar heelc29
heelc29 - comment - 20 May 2026

I have tested this item ✅ successfully on 439a4e6


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

avatar CSGoat0
CSGoat0 - comment - 20 May 2026

The npm error is gone, the \\ in codemirror changed to / but as I've mentioned, the codemirror still looks like this in my setup:
image

In plg_editors_codemirror, when I added this missing line manually there, the codemirror worked correctly.
image

I don't know if it's related only to my setup but I tried more than three times and got the same reason.
The expected view of codemirror in my setup looks like this:

image
avatar CSGoat0
CSGoat0 - comment - 20 May 2026

The npm error is gone, the \\ in codemirror changed to / but as I've mentioned, the codemirror still looks like this in my setup:
image

In plg_editors_codemirror, when I added this missing line manually there, the codemirror worked correctly.
image

I don't know if it's related only to my setup but I tried more than three times and got the same result.
The expected view of codemirror in my setup looks like this:

image
avatar CSGoat0
CSGoat0 - comment - 21 May 2026

6.2 after importmaps using inlineDynamicImports: true (working)
joomla.asset.json

5.4
joomla.asset.json

After comparing my working versions of 6.2 and 5.4 what I found is:

  • 5.4 have the paths contain / not \\ and it works
  • 6.2 have the paths contain \\ not / and it works
  • Both 5.4 and 6.2 have "version": "5.0.0" or "version": "6.0.0" and both works
  • This patch generated file has \\ not / (it's not a problem) but doesn't have "version": "6.0.0" (this is the problem).

@LadySolveig, I see that both \\ and / works correctly but not sure which are the correct approach.
the only problem now is just the "version" is not added.
also, if both are correct approaches then we don't need to user .replace().

avatar CSGoat0
CSGoat0 - comment - 21 May 2026

6.2 after importmaps using inlineDynamicImports: true (working)
joomla.asset.json

5.4
joomla.asset.json

After comparing my working versions of 6.2 and 5.4 what I found is:

  • 5.4 have the paths contain / not \\ and it works
  • 6.2 have the paths contain \\ not / and it works
  • Both 5.4 and 6.2 have "version": "5.0.0" or "version": "6.0.0" and both works
  • This patch generated file has \\ not / (it's not a problem) but doesn't have "version": "6.0.0" (this is the problem).

@LadySolveig, I see that both \\ and / works correctly but not sure which are the correct approach.
the only problem now is just the "version" is not added.
also, if both are correct approaches then we don't need to use .replace().

avatar LadySolveig
LadySolveig - comment - 21 May 2026

@CSGoat0 Thank you for the report and further testing. As discussed here we don't want to use the inlineDynamicImports
https://github.com/joomla/joomla-cms/pull/47680/changes/BASE..3f335799c5f1bbaf7f9674f544b94123ae8c1a75#r3137880336

I can look into later where this behavior might come from and if there's an inconsistency here.
Could you please try to have someone reproduce your issue in parallel (perhaps ask in the BugSquad or Developer Channel on Mattermost)?

avatar CSGoat0
CSGoat0 - comment - 21 May 2026

@LadySolveig I am not suggesting to use inlineDynamics, what I mean is when i had the complied media folder on windows after importmaps Implementation somehow (inlineDynamics), this is what i get.

The variations among both 5.4 and 6.2 is already confirmed (by others) in the first PR.
The Version is missing when comparing 5.4 to 6.2 just as the replacement of / with \\.
You can confirm that probably even without windows device if you can look into joomla.asset.json of 6.2 after importmaps Implementation. If you have the \\ in the file then you won't have the version.

Even if it works on some browser without the Version and doesn't work on some others, it's still a missing piece compared with 5.4 no? The issue isn't that codemirror doesn't work for me, it's that the file is different from 5.4.

I am just trying to help 😊

avatar LadySolveig
LadySolveig - comment - 21 May 2026

It's great that you mentioned the issue again here. @CSGoat0

However, it actually has very little to do with the path fix which we made here. 😊

Would you please check if it is already missing from the original file.
media_source/plg_editors_codemirror/joomla.asset.json

{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "plg_editors_codemirror",
"version": "5.0.0",

Please try to do it all over again in a fresh empty folder and pull the branch. Then check again.


Only additional explanation

The only way I can explain you issue that it must already be missing here.
The build script does nothing more than read the file here

const registry = JSON.parse(fs.readFileSync(srcPath, { encoding: 'utf8' }));

and populate it after filling it with the dynamic data from the build process

return fsp.writeFile(destPath, JSON.stringify(registry, null, 2), { encoding: 'utf8', mode: 0o644 });

avatar LadySolveig
LadySolveig - comment - 21 May 2026

It's great that you mentioned the issue again here. @CSGoat0

However, it actually has very little to do with the path fix which we made here. 😊

Would you please check if it is already missing from the original file.
media_source/plg_editors_codemirror/joomla.asset.json

{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "plg_editors_codemirror",
"version": "5.0.0",

Please try to do it all over again in a fresh empty folder and pull the branch. Then check again.


Only additional explanation

The only way I can explain your issue, that it must already be missing here.
The build script does nothing more than read the file here

const registry = JSON.parse(fs.readFileSync(srcPath, { encoding: 'utf8' }));

and populate it after filling it with the dynamic data from the build process

return fsp.writeFile(destPath, JSON.stringify(registry, null, 2), { encoding: 'utf8', mode: 0o644 });

avatar MacJoom MacJoom - change - 23 May 2026
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-05-23 12:54:05
Closed_By MacJoom
avatar MacJoom MacJoom - close - 23 May 2026
avatar MacJoom MacJoom - merge - 23 May 2026
avatar MacJoom
MacJoom - comment - 23 May 2026

Thank you all!

Add a Comment

Login with GitHub to post a comment