-
Notifications
You must be signed in to change notification settings - Fork 18
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: Babel TypeError due to event-target-shim #365
Conversation
This pull request has been linked to Shortcut Story #232716: Fix event-target-shim TypeError. |
"expo": "~50.0.6", | ||
"expo-splash-screen": "~0.26.4", | ||
"expo-status-bar": "~1.11.1", | ||
"react": "18.2.0", | ||
"react-native": "0.72.6", | ||
"react-native": "0.73.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main changes are expo 50 and rn 0.73.
@@ -2,7 +2,7 @@ | |||
* Ripped from: | |||
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Events/CustomEvent.js#L21 | |||
*/ | |||
import { Event } from 'event-target-shim'; | |||
import { Event } from 'event-target-shim/es5'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the babel TypeError.
🤖 I have created a release *beep* *boop* --- <details><summary>js-client-sdk-common: 0.2.1</summary> ## [0.2.1](js-client-sdk-common-v0.2.0...js-client-sdk-common-v0.2.1) (2024-02-07) ### Bug Fixes * Minor fixes from docs pr review. ([#363](#363)) ([4768bf7](4768bf7)) </details> <details><summary>react-native-client-sdk: 0.2.1</summary> ## [0.2.1](react-native-client-sdk-v0.2.0...react-native-client-sdk-v0.2.1) (2024-02-07) ### Bug Fixes * Babel TypeError due to event-target-shim ([#365](#365)) ([c1c0086](c1c0086)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 0.2.0 to 0.2.1 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This is a babel issue related to the event-target-shim package. For unknown reasons, in Expo 50, the metro bundler is unable to transpile event-target-shim correctly resulting in the error below.
Thankfully the event-target-shim package offers a transpiled es5 version which seems to work. We'll use that instead.