Skip to content

module: default to commonjs when format cannot be detected #52988

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

avivkeller
Copy link
Member

@avivkeller avivkeller commented May 14, 2024

When --experimental-detect-module is enabled, the default format will no longer be commonjs; instead, it will be null until the source is loaded. In this PR, the behavior is changed to default to commonjs, aligning with the non-experimental behavior.

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels May 14, 2024
@GeoffreyBooth
Copy link
Member

@nodejs/loaders

@GeoffreyBooth GeoffreyBooth added the module Issues and PRs related to the module subsystem. label May 14, 2024
@GeoffreyBooth
Copy link
Member

This seems to undo part of #50314 but not necessarily incorrectly; @aduh95 can you please review?

@avivkeller
Copy link
Member Author

avivkeller commented May 14, 2024

This change, while it resolves one issue, it introduces several others (E.G. node --experimental-detect-module /xxx/test/fixtures/es-modules/package-without-type/module.js will not work now)

@avivkeller avivkeller marked this pull request as draft May 14, 2024 20:31
@avivkeller
Copy link
Member Author

Marking as draft, as some things need to worked out before this is ready

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants