Package namespaces migration throwing an "EventEmitter" error

:backhand_index_pointing_right: Bug Description


1. Summary

After following the steps on the developers guide for updating the package namespace and the update made successfully I was able to install dependencies (npm i), and build the app (npm run build:app). Everything seemed to be installed and build correctly (I had to reinsert an assets folder that the Scope Migrator Tool deleted); but when I’m trying to launch the app, it starts apparently successfully, but then I got an error related to the un-ability to read “EventEmitter” of undefined, and then the app get stuck.

App Name: “com.univision.prendetv"
App Link on Amazon Appstore: The branch with the namespaces update has not been merged, therefore the issue is not on the Appstore yet.

Bug Severity
Select one that applies

  • Impacts operation of app
  • Blocks current development
  • Improvement suggestion
  • Issue with documentation (If selected, please share the doc link and describe the issue)
  • Other

2. Steps to Reproduce

  1. Follow the scope migrator tool 1. guide
  2. Re introduce the needed Assets content
  3. Run npm install to install all the new packages and generate a new package.json
  4. Build the application
  5. Start metro server
  6. Start forwarding the device
  7. Install the current build
  8. Launch the app
  9. Observe the logs on the terminal throwing an error related to an “EventEmitter”
  10. The app get stuck there.

3. Observed Behavior

Explain what actually happened, noting any discrepancies or malfunctions.

The app throws an error related to an EventEmitter and get stuck

4. Expected Behavior

Describe what you expected the SDK to do under normal operation.

The app should run as expected with the reference to the new package namespaces

4.a Possible Root Cause & Temporary Workaround

Fill out anything you have tried. If you don’t know, N/A is acceptable

I follow some forums Q&A and tried adding a couple of probably "missing" libraries but it did not workd.
Also tried to run some libraries with lowest versions but I was not able to fin a compatible one

5. Logs or crash report

Fatal error suppressed.
 (NOBRIDGE) ERROR  Global error caught: [TypeError: Cannot read property 'EventEmitter' of undefined] 
    at AppWrapper (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148710:48)
    at QueryClientProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:188890:22)
    at AnalyticsProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:272434:22)
    at App (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148651:106)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at AppContainer (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60700:36)
    at com.univision.prendetv.main(RootComponent) (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:110648:28)
 (NOBRIDGE) LOG  Fatal error suppressed.
 (NOBRIDGE) ERROR  Global error caught: [TypeError: Cannot read property 'EventEmitter' of undefined] 
    at AppWrapper (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148710:48)
    at QueryClientProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:188890:22)
    at AnalyticsProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:272434:22)
    at App (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148651:106)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at AppContainer (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60700:36)
    at com.univision.prendetv.main(RootComponent) (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:110648:28)
 (NOBRIDGE) LOG  Fatal error suppressed.
 (NOBRIDGE) ERROR  Global error caught: [TypeError: Cannot read property 'EventEmitter' of undefined] 
    at AppWrapper (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148710:48)
    at QueryClientProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:188890:22)
    at AnalyticsProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:272434:22)
    at App (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148651:106)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at AppContainer (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60700:36)
    at com.univision.prendetv.main(RootComponent) (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:110648:28)

For crash issues, please refer this guide for faster troubleshooting: Detect Where the App Crash Originates | Design and Develop Vega Apps

  • App/Device Logs

  • Crash Logs

  • Crash Report

  • For issues with Kepler Studio Extension, please share log files from below folders:

     ~/.vscode/extensions/amazon.kepler-extension-<version>/ExtensionLogs
     ~/.vscode/extensions/amazon.kepler-ui-extension-<version>/ExtensionLogs
    

6. Environment

Please fill out the fields related to your bug below:

  • SDK Version: 0.20.3719

  • App State: [Foreground]

  • OS Information
    Please ssh into the device via kepler exec vda shelland copy the output from cat /etc/os-releaseinto the answer section below. Note, if you don’t have a simulator running or device attached kepler exec vda shell will respond with vda: no devices/emulators found

    NAME="OS"
    OE_VERSION="4.0.0"
    OS_MAJOR_VERSION="1"
    OS_MINOR_VERSION="1"
    RELEASE_ID="14"
    OS_VERSION="1.1"
    BRANCH_CODE="TV Ship day60"
    BUILD_DESC="OS 1.1 (TV Ship day60/4454)"
    BUILD_FINGERPRINT="4.0.198430.0(3072cab629675a74)/4454N:user-external/release-keys"
    BUILD_VARIANT="user-external"
    BUILD_TAGS="release-keys"
    BUILD_DATE="Sat Dec 20 04:05:59 UTC 2025"
    BUILD_TIMESTAMP="1766203559"
    VERSION_NUMBER="1401010445450"
    sh(com.amazon.dev.shell):/$ 
    
    

7. Example Code Snippet / Screenshots / Screengrabs

Include any relevant code or component setup in React Native that can help reproduce the bug.

(NOBRIDGE) ERROR  Global error caught: [TypeError: Cannot read property 'EventEmitter' of undefined] 
    at AppWrapper (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148710:48)
    at QueryClientProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:188890:22)
    at AnalyticsProvider (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:272434:22)
    at App (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:148651:106)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60846:26)
    at AppContainer (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:60700:36)
    at com.univision.prendetv.main(RootComponent) (http://localhost:8081/index.bundle//&platform=kepler&dev=true&minify=false:110648:28)


:backhand_index_pointing_right: Additional Context


Any Additional Context you would like to provide?
Add any other relevant information, such as recent updates to the SDK, dependencies, or device OS that may affect the bug.

I had to re instert my asset folder, since python scope_migrator.py --no-dry-run deleted it.

Also I had to run the command with python3 instead of just python

Hi @Jordi_Garcia,

Thank you for the detailed bug report on the EventEmitter error following package namespace migration.

Our team is investigating this issue and will provide an update as soon as we have more information.

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

Hi Jordi,

To help us investigate this issue further, could you please share the complete list of all dependencies and devDependencies your app has before and after running the migration tool?

This information will help us identify any potential conflicts between the old and new package scopes.

Thanks for your patience as we work to resolve this issue.

Warm regards,
Aishwarya

Hi, sorry the late reply, sure

This are the dependencies and devDependencies from before runnning the tool:


"overrides": {

    "react-native-gesture-handler": "$react-native-gesture-handler",

"@react-native-async-storage/async-storage": "npm:@amzn/react-native-async-storage__async-storage@2.0.1751782280"

  },

"dependencies": {

"@akta-tech/lura-player-react-native": "https://w3.mp.lura.live/lura-player/react-native/4.3.3/@akta-tech/lura-player-react-native.tgz",

"@akta-tech/lura-player-react-native-conviva-plugin": "https://w3.mp.lura.live/lura-player/react-native/4.3.3/@akta-tech/lura-player-react-native-conviva-plugin.tgz",

"@akta-tech/lura-player-react-native-ui": "https://w3.mp.lura.live/lura-player/react-native/4.3.3/@akta-tech/lura-player-react-native-ui.tgz",

"@amazon-devices/react-native-device-info": "2.0.1758683737",

"@amzn/expo-asset": "2.0.1751782280",

"@amzn/expo-constants": "2.0.1751782280",

"@amzn/expo-font": "2.0.1751782280",

"@amzn/headless-task-manager": "1.2.4",

"@amzn/kepler-media-account-login": "1.1.8",

"@amzn/kepler-media-content-launcher": "2.0.8",

"@amzn/kepler-media-controls": "1.0.9",

"@amzn/kepler-ui-components": "2.3.0",

"@amzn/keplerscript-appstore-iap-lib": "2.12.10",

"@amzn/keplerscript-epg": "2.7.0",

"@amzn/keplerscript-react-native-reanimated": "2.0.1751782280",

"@amzn/keplerscript-turbomodule-api": "1.2.4",

"@amzn/package-manager-lib": "1.0.1751782280",

"@amzn/react-linear-gradient": "2.0.1751782280",

"@amzn/react-native-device-info": "2.0.1751782280",

"@amzn/react-native-fast-image": "3.0.6",

"@amzn/react-native-gesture-handler": "2.0.1751782280",

"@amzn/react-native-kepler": "2.0.1755826470",

"@amzn/react-native-safe-area-context": "2.0.1751782280",

"@amzn/react-native-screens": "2.0.1751782280",

"@amzn/react-native-svg": "2.0.1751782280",

"@amzn/react-native-w3cmedia": "2.1.80",

"@amzn/react-navigation__core": "2.0.1751782280",

"@amzn/react-navigation__drawer": "2.0.1751782280",

"@amzn/react-navigation__native": "2.0.1751782280",

"@amzn/react-navigation__routers": "2.0.1751782280",

"@amzn/react-navigation__stack": "2.0.1751782280",

"@amzn/shopify__flash-list": "2.0.1758683737",

"@react-native-async-storage/async-storage": "npm:@amzn/react-native-async-storage__async-storage@2.0.1751782280",

"@segment/analytics-react-native": "2.20.0-beta.2",

"@segment/analytics-react-native-plugin-kepler": "1.0.0",

"@tanstack/react-query": "5.64.0",

"axios": "1.11.0",

"date-fns": "4.1.0",

"graphql": "16.11.0",

"graphql-request": "7.1.2",

"i18next": "23.16.8",

"lodash.get": "4.4.2",

"lodash.isequal": "4.5.0",

"react": "18.2.0",

"react-i18next": "14.1.3",

"react-native": "0.72.0",

"react-native-gesture-handler": "npm:@amzn/react-native-gesture-handler@2.0.1751782280",

"react-native-render-html": "6.3.4",

"react-native-svg": "npm:@amzn/react-native-svg@2.0.1751782280",

"react-native-uuid": "2.0.3",

"use-debounce": "10.0.6",

"zustand": "4.5.7"

  },

"resolutions": {

"metro": "0.76.5",

"@types/react": "18"

  },

"devDependencies": {

"@amazon-devices/eslint-plugin-kepler": "0.1.4",

"@amazon-devices/kepler-performance-api": "0.1.2",

"@amzn/kepler-cli-platform": "0.18.7",

"@amzn/kepler-performance-api": "0.0.1",

"@babel/core": "7.22.8",

"@babel/plugin-transform-private-methods": "7.27.1",

"@babel/runtime": "7.22.15",

"@react-native-community/cli": "11.3.2",

"@react-native-community/eslint-config": "3.2.0",

"@react-native/eslint-config": "0.72.2",

"@react-native/metro-config": "0.72.12",

"@testing-library/react-native": "11.5.4",

"@types/crypto-js": "4.2.2",

"@types/jest": "28.1.8",

"@types/react": "18.3.24",

"@types/react-native-dotenv": "0.2.2",

"@types/react-test-renderer": "18.3.1",

"@typescript-eslint/eslint-plugin": "5.62.0",

"@typescript-eslint/parser": "5.62.0",

"@welldone-software/why-did-you-render": "8.0.3",

"babel-jest": "28.1.3",

"babel-plugin-module-resolver": "5.0.2",

"babel-plugin-transform-remove-console": "6.9.4",

"concurrently": "8.2.2",

"eslint": "8.57.1",

"eslint-config-airbnb": "19.0.4",

"eslint-config-airbnb-typescript": "16.2.0",

"eslint-import-resolver-typescript": "2.4.0",

"eslint-plugin-import": "2.32.0",

"eslint-plugin-jest": "26.9.0",

"eslint-plugin-jsdoc": "46.10.1",

"eslint-plugin-jsx-a11y": "6.10.2",

"eslint-plugin-oxlint": "0.1.0",

"eslint-plugin-react": "7.37.5",

"eslint-plugin-react-hooks": "4.6.2",

"eslint-plugin-react-native": "5.0.0",

"eslint-plugin-react-perf": "3.3.3",

"eslint-plugin-simple-import-sort": "5.0.3",

"husky": "9.1.7",

"i18next-resources-for-ts": "1.7.4",

"jest": "28.1.3",

"lint-staged": "15.5.2",

"metro-react-native-babel-preset": "0.76.9",

"npm-run-all": "4.1.5",

"patch-package": "8.0.0",

"prettier": "2.8.8",

"react-native-dotenv": "3.4.11",

"react-test-renderer": "18.2.0",

"ts-jest": "28.0.8",

"typescript": "4.9.5"

  },

And this are the ones after running the tool

"overrides": {

    "react-native-gesture-handler": "npm:@amazon-devices/react-native-gesture-handler@~2.0.0",

"@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@~2.0.0"

  },

"dependencies": {

"@akta-tech/lura-player-react-native": "https://w3.mp.lura.live/lura-player/react-native/4.3.3/@akta-tech/lura-player-react-native.tgz",

"@akta-tech/lura-player-react-native-conviva-plugin": "https://w3.mp.lura.live/lura-player/react-native/4.3.3/@akta-tech/lura-player-react-native-conviva-plugin.tgz",

"@akta-tech/lura-player-react-native-ui": "https://w3.mp.lura.live/lura-player/react-native/4.3.3/@akta-tech/lura-player-react-native-ui.tgz",

"@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@~2.0.0",

"@segment/analytics-react-native": "2.20.0-beta.2",

"@segment/analytics-react-native-plugin-kepler": "1.0.0",

"@tanstack/react-query": "5.64.0",

"axios": "1.13.2",

"date-fns": "4.1.0",

"graphql": "16.12.0",

"graphql-request": "7.1.2",

"i18next": "23.16.8",

"lodash.get": "4.4.2",

"lodash.isequal": "4.5.0",

"react": "18.2.0",

"react-i18next": "14.1.3",

"react-native": "0.72.0",

"react-native-gesture-handler": "npm:@amazon-devices/react-native-gesture-handler@~2.0.0",

"react-native-render-html": "6.3.4",

"react-native-svg": "npm:@amazon-devices/react-native-svg@~2.0.1722663255",

"react-native-uuid": "2.0.3",

"use-debounce": "10.0.6",

"zustand": "4.5.7",

"@amazon-devices/react-navigation__drawer": "7.0.1758683737",

"@amazon-devices/react-navigation__stack": "7.0.1758683737",

"@amazon-devices/react-navigation__routers": "7.0.1758683737",

"@amazon-devices/react-navigation__core": "7.0.1758683737",

"@amazon-devices/react-navigation__native": "7.0.1758683737",

"@amazon-devices/expo-asset": "2.0.1758683737",

"@amazon-devices/expo-constants": "2.0.1758683737",

"@amazon-devices/expo-font": "2.0.1758683737",

"@amazon-devices/headless-task-manager": "1.2.4",

"@amazon-devices/kepler-media-account-login": "1.1.12",

"@amazon-devices/kepler-media-content-launcher": "2.0.13",

"@amazon-devices/kepler-media-controls": "1.0.17",

"@amazon-devices/kepler-ui-components": "2.4.1",

"@amazon-devices/keplerscript-appstore-iap-lib": "2.12.13",

"@amazon-devices/keplerscript-epg": "2.8.3",

"@amazon-devices/keplerscript-react-native-reanimated": "2.0.1758683737",

"@amazon-devices/keplerscript-turbomodule-api": "1.2.5",

"@amazon-devices/react-linear-gradient": "2.0.1758683737",

"@amazon-devices/react-native-device-info": "2.0.1758683737",

"@amazon-devices/react-native-fast-image": "3.0.6",

"@amazon-devices/react-native-gesture-handler": "2.0.1758683737",

"@amazon-devices/react-native-kepler": "~2.0.1758683737",

"@amazon-devices/react-native-safe-area-context": "2.0.1758683737",

"@amazon-devices/react-native-screens": "2.0.1758683737",

"@amazon-devices/react-native-svg": "2.0.1758683737",

"@amazon-devices/react-native-w3cmedia": "2.1.87",

"@amazon-devices/shopify__flash-list": "2.0.1758683737"

  },

"resolutions": {

"metro": "0.76.5",

"@types/react": "18"

  },

"devDependencies": {

"@amazon-devices/eslint-plugin-kepler": "0.1.4",

"@amazon-devices/kepler-performance-api": "0.1.2",

"@babel/core": "7.22.20",

"@babel/plugin-transform-private-methods": "7.27.1",

"@babel/runtime": "7.22.15",

"@react-native-community/cli": "11.3.2",

"@react-native-community/eslint-config": "3.2.0",

"@react-native/eslint-config": "0.72.2",

"@react-native/metro-config": "0.72.12",

"@testing-library/react-native": "11.5.4",

"@types/crypto-js": "4.2.2",

"@types/jest": "28.1.8",

"@types/react": "18.3.27",

"@types/react-native-dotenv": "0.2.2",

"@types/react-test-renderer": "18.3.1",

"@typescript-eslint/eslint-plugin": "5.62.0",

"@typescript-eslint/parser": "5.62.0",

"@welldone-software/why-did-you-render": "8.0.3",

"babel-jest": "28.1.3",

"babel-plugin-module-resolver": "5.0.2",

"babel-plugin-transform-remove-console": "6.9.4",

"concurrently": "8.2.2",

"eslint": "8.57.1",

"eslint-config-airbnb": "19.0.4",

"eslint-config-airbnb-typescript": "16.2.0",

"eslint-import-resolver-typescript": "2.7.1",

"eslint-plugin-import": "2.32.0",

"eslint-plugin-jest": "26.9.0",

"eslint-plugin-jsdoc": "46.10.1",

"eslint-plugin-jsx-a11y": "6.10.2",

"eslint-plugin-oxlint": "0.1.0",

"eslint-plugin-react": "7.37.5",

"eslint-plugin-react-hooks": "4.6.2",

"eslint-plugin-react-native": "5.0.0",

"eslint-plugin-react-perf": "3.3.3",

"eslint-plugin-simple-import-sort": "5.0.3",

"husky": "9.0.11",

"i18next-resources-for-ts": "1.7.4",

"jest": "~28.1.3",

"lint-staged": "15.5.2",

"metro-react-native-babel-preset": "0.76.9",

"npm-run-all": "4.1.5",

"patch-package": "8.0.1",

"prettier": "2.8.8",

"react-native-dotenv": "3.4.11",

"react-test-renderer": "18.2.0",

"ts-jest": "28.0.8",

"typescript": "4.9.5",

"@amazon-devices/kepler-cli-platform": "0.21.2"

  },

Please let me know if you need any other information or if you need it in a different format

Hi @Jordi_Garcia,

Thanks for providing the detailed dependency information. The migration itself appears to have completed successfully—we don’t see any mixing of @amzn and @amazon-devices dependencies.

The issue is likely related to these packages:

  • @segment/analytics-react-native-plugin-kepler

  • @segment/analytics-react-native

To help us narrow this down, could you please provide:

  1. Output of kepler -v and vega -v

  2. Confirmation of the SDK version installed via VVM

  3. If SDK v0.22 is installed, confirmation that the app worked correctly pre-migration

  4. Any build-time or runtime errors related to the Segment packages mentioned above

  5. A brief usage example showing how you’re using these packages in your app

Additionally, please perform a clean reinstall to rule out any residual environment or dependency issues:

This includes both a clean SDK install and a fresh node_modules install:

# Clean node_modules and package-lock.json
rm -rf node_modules package-lock.json

# Reinstall dependencies
npm install

# Rebuild the app
npm run build:app

Please let us know if the error persists after the clean reinstall and provide the information requested above.

Thanks for your patience!

Warm regards,
Aishwarya

Hi @amen

Thank you for your response, I have tried the clean SDK install a reinstall of the node_modules, and it made me update a version of a w3cmedia library, however I am still facing the same issue related to the eventemitter, according on what you asked for:

Output of kepler -v and vega -v

Active SDK Version: 0.22.5850

Vega CLI Version: 1.2.13

Confirmation of the SDK version installed via VVM:
I followed the steps on this guide and the versions above are the ones installed

If SDK v0.22 is installed, confirmation that the app worked correctly pre-migration:
After updating to the latest Vega version, I re build our project from our master branch and everything ran and worked successfully

Any build-time or runtime errors related to the Segment packages mentioned above:
For this the only thing that happened before was an error for incompatibility of version

That happened when we used to use a .tgz file from segment, now all of that is on and npm package, and I was able to build correctly, but then I got the eventemitter issue

A brief usage example showing how you’re using these packages in your app:
Some use examples of the libraries are the follow:

import { createClient } from '@segment/analytics-react-native-plugin-kepler'; 
const segmentClient = createClient({ writeKey: context.writeKey, trackAppLifecycleEvents: true, });
import { JsonMap, useAnalytics } from '@segment/analytics-react-native';

const {track, screen, reset,  } = useAnalytics();

Please let me know if you need anything else, or if maybe we should reach out to our segment provider and ask them for some evidences or request them some changes

Thank you!