Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: esm loader fix #8146

Merged
merged 2 commits into from
Feb 29, 2024
Merged

fix: esm loader fix #8146

merged 2 commits into from
Feb 29, 2024

Conversation

Bayheck
Copy link
Collaborator

@Bayheck Bayheck commented Feb 22, 2024

Purpose

Starting from Node version 20 Hooks like load run in a separate thread, isolated from the main thread.
https://nodejs.org/docs/latest-v20.x/api/module.html#hooks.

Our current implementation relies on main thread in getTestFileCompilers.
Because the load hook is now running in a separate thread the testFileCompilers was never initialized before, and getTestFileCompilers calls initTestFileCompilers with no parameters. That is why the esm flag is lost in Node version 20 and above.

Approach

Pass the esm flag from load hook to getTestFileCompilers` in order to initialize the correct compilers.

The test 'Should import ESM without errors in ESM mode' also works for this fix in node 20 and above.

References

closes #8132

Pre-Merge TODO

  • Write tests for your proposed changes
  • Make sure that existing tests do not fail

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 22, 2024
@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 22, 2024
@aleks-pro aleks-pro merged commit 4a30f1c into DevExpress:master Feb 29, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to run the tests in ESM
3 participants