emberjs / emberjs/ember-cli-babel

Private property transpilation broken w/ externalHelpers enabled

Open
#442 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
152
Forks
115
Avg merge
23h 22m
Merged PRs (30d)
4

Description

ember-cli-babel currently has a pinned dependency of `@babel/runtime` 7.12.18. If a newer version (like 7.17.9) for whatever reason ends up on the root level of `node_modules` (like other dependencies bringing in a newer version) it may break the build at runtime in certain cases. The specific case that I ran into occurs when using private properties in native classes like in this reproduction: https://github.com/nickschot/babel-test-app/blob/master/app/controllers/application.js#L9

with `externalHelpers: true` configured [in ember-cli-build](https://github.com/nickschot/babel-test-app/blob/master/ember-cli-build.js#L9).

When running the app this will result in a runtime error like:
Screenshot 2022-04-25 at 16 06 39

The reproduction uses a private property in an app controller, but the same issue happens when addons use private properties in for example components.

Note that for the linked reproduction I've added a dependency on `@babel/runtime` 7.17.9 to force this issue. Disabling `externalHelpers` and/or making sure the version of `@babel/runtime` in the root of `node_modules` is 7.12.18 prevents the issue from occurring.

The pinning happened here: https://github.com/babel/ember-cli-babel/pull/385
May be somewhat related to: https://github.com/babel/ember-cli-babel/pull/420

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.