Troubleshoot React Native 0.83 Migration Issues
This document guides you through solutions to common errors encountered when migrating an app to React Native 0.83.
npm errors
ERESOLVE — Peer dependency resolution failure
Error: ERESOLVE unable to resolve dependency tree
Fix:
- Clean install:
rm -rf node_modules package-lock.json npm install - If still failing, identify the conflict from the error output ("Found: X" vs "Could not resolve: Y")
- Ensure all dependency versions match the target RN 0.83 requirements
- Never use
--legacy-peer-deps— it masks conflicts that cause runtime errors
Peer react version conflict (cached 0.72)
Error: peer react@... from react-native@0.72 or Conflicting peer dependency: react@19
Cause: Cached react-native@0.72.0 in node_modules conflicts with React 19.
Fix:
rm -rf node_modules package-lock.json
Verify package.json has "react": "19.2.0", "react-native": "0.83.0", "@types/react": "^19.2.0".
@types/react version mismatch
Error: Found: @types/react@18 / peerOptional @types/react@^19
Fix: Update devDependencies:
"@types/react": "^19.2.0",
"@types/react-test-renderer": "^19.1.0"
ts-jest peer dependency conflict
Error: peer jest@^28.0.0 from ts-jest
Fix: Update ts-jest to match jest v29:
"ts-jest": "^29.1.0"
TypeScript errors
tsconfig.json extends not found
Error: TS6053: File '@react-native/typescript-config/tsconfig.json' not found
Fix:
"extends": "@react-native/typescript-config"
(Remove the /tsconfig.json suffix)
allowImportingTsExtensions / customConditions
Error: TS5096 or TS5098
Fix: Add overrides to tsconfig.json:
"compilerOptions": {
"moduleResolution": "bundler",
"allowImportingTsExtensions": false
}
Re-exporting type with isolatedModules
Error: TS1205: Re-exporting a type when 'isolatedModules' is enabled
Fix:
export type { Cookie } from './types/CookieManagerTypes';
CMake and native build errors
keplerscript target not found
Error: Target links to keplerscript-2 but the target was not found
Fix: In cxx/CMakeLists.txt:
# Change all references:
keplerui::keplerscript-2 → keplerui::keplerscript-4
C++20 features not supported
Error: C++20 features not supported
Fix: Ensure CMake 3.22+ and a C++20-compatible compiler (GCC 10+, Clang 12+).
Metro Bundler Errors
Cannot find module '@react-native/babel-preset'
Fix:
rm -rf node_modules
npm install
npm start -- --reset-cache
Unable to resolve module
Fix:
rm -rf node_modules/.cache
npm start -- --reset-cache
Jest and testing errors
SyntaxError: Cannot use import statement outside a module (platform package)
Cause: @amazon-devices/react-native-kepler@4.0.0 uses ES modules in its jest setup.
Fix: Add to transformIgnorePatterns in jest.config:
"node_modules/(?!((jest-)?react-native|@react-native(-community)?|@amazon-devices/react-native-kepler)|react-native-safe-area-context)"
Cannot read properties of undefined (Dimensions/PixelRatio/StyleSheet)
Cause: React 19 changed mock behavior. These APIs aren't automatically mocked.
Fix: Add mocks to jest.setup.js (see Step 7.2).
Can't access .root on unmounted test renderer
Cause: Wrapping @testing-library/react-native render() in ReactTestRenderer.act().
Fix: Remove act() wrapping — the testing library handles it internally (see Step 7.4).
NativeAnimatedModule method stubs missing
Error: Cannot read properties of undefined (reading 'apply') in NativeAnimatedHelper.js
Cause: RN 0.83 animation system calls 23 specific methods on NativeAnimatedModule.
Fix: Add complete mock to jest.setup.js (see Step 7.2).
Navigation stack timer leak
Error: You are trying to import a file after the Jest environment has been torn down
Fix:
beforeEach(() => jest.useFakeTimers());
afterEach(() => {
jest.runOnlyPendingTimers();
jest.useRealTimers();
});
Nested react-native in keplerscript-native-ui-components
Error: Flow/ESM parse errors from keplerscript-native-ui-components/node_modules/react-native
Cause: kepler-ui-components@2.x bundles its own copy of react-native.
Fix: Update to @amazon-devices/kepler-ui-components@3.0.0.
Runtime errors
Failed to load runtime module: IKeplerScript_2_0
Cause: manifest.toml still references old Kepler 2.x runtime.
Fix: Update manifest.toml runtime-module paths (see Phase 4).
Cannot find module '@amazon-devices/keplerscript-commonmodules'
Fix: Add to devDependencies:
"@amazon-devices/keplerscript-commonmodules": "^1.0.0"
Unrecognized command build-kepler
Cause: @react-native-community/cli was removed.
Fix: Keep in devDependencies:
"@react-native-community/cli": "11.3.2"
ReferenceError: useState is not defined
Fix: Add explicit import:
import React, { useState, useEffect, useCallback } from 'react';
Last updated: Jul 09, 2026

