Skip to content

fix Babel 8 commander import - #16548

Merged
nicolo-ribaudo merged 1 commit into
babel:mainfrom
JLHwung:fix-commander-import-babel-8
Jun 4, 2024
Merged

nicolo-ribaudo merged 1 commit into
babel:mainfrom
JLHwung:fix-commander-import-babel-8

Conversation

@JLHwung

@JLHwung JLHwung commented Jun 4, 2024

Copy link
Copy Markdown
Contributor
Q 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 A
Fixed Issues? Fixes #16547
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Previously the Babel 8 test in #16517 was passing because we the condition proxy package is marked as CJS only, as we did not specify the esm exports for the commander package. The commander v12 is a dual package, so essentially we were importing a CJS wrapper of commander, which breaks Babel 8 since the ESM version should be used.

Idea for the yarn conditional plugin: make the esm condition clause required when some of dependents are dual / esm-only packages, otherwise users end up using CJS wrappers of those packages.

@JLHwung JLHwung added the PR: Bug Fix (next major) 馃悰 A type of pull request used for our changelog categories for next major release label Jun 4, 2024
@babel-bot

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57108

@nicolo-ribaudo nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll release a new alpha

@nicolo-ribaudo
nicolo-ribaudo merged commit ec0c62a into babel:main Jun 4, 2024
@nicolo-ribaudo
nicolo-ribaudo deleted the fix-commander-import-babel-8 branch June 4, 2024 07:44
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 2, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix (next major) 馃悰 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 8.0.0-alpha.9 [commander] TypeError: Cannot read properties of undefined (reading 'program')

3 participants