Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazonアプリストア
Ring
AWS
ドキュメント
Support
Contact Us
My Cases
開発
設計と開発
公開
リファレンス
サポート
Skip to main content
このドキュメントでは、アプリをReact Native 0.83に移行するときに発生する一般的なエラーの解決策について説明します。

npmのエラー

ERESOLVE - ピア依存関係の解決が失敗する

エラー: ERESOLVE unable to resolve dependency tree 修正:
  1. クリーンインストールを行います。
  2. それでもエラーが発生する場合は、エラー出力(「Found: X」と「Could not resolve: Y」)から競合を特定します。
  3. 依存関係のすべてのバージョンが、ターゲットのRN 0.83の要件と一致していることを確認します。
  4. --legacy-peer-depsは使用しないでください。使用すると、ランタイムエラーを引き起こす競合が隠されてしまいます。

ピアのreactバージョンが競合する(0.72がキャッシュされている)

エラー:peer react@... from react-native@0.72またはConflicting peer dependency: react@19 原因: node_modulesにキャッシュされたreact-native@0.72.0がReact 19と競合しています。 修正:
package.jsonに、"react": "19.2.0"、"react-native": "0.83.0"、"@types/react": "^19.2.0"が含まれていることを確認します。

@types/reactのバージョンが一致しない

エラー: Found: @types/react@18 / peerOptional @types/react@^19 修正: devDependenciesを更新します。

ts-jestのピア依存関係が競合する

エラー:peer jest@^28.0.0 from ts-jest 修正: ts-jestをjest v29に一致するように更新します。

TypeScriptのエラー

extendsに指定したtsconfig.jsonが見つからない

エラー: TS6053: File '@react-native/typescript-config/tsconfig.json' not found 修正:
(/tsconfig.jsonというサフィックスを削除します)

allowImportingTsExtensionsまたはcustomConditions

エラー: TS5096またはTS5098 修正: tsconfig.jsonにオーバーライドを追加します。

isolatedModulesで型の再エクスポートがエラーになる

エラー: TS1205: Re-exporting a type when 'isolatedModules' is enabled 修正:

CMakeとネイティブビルドに関するエラー

keplerscriptターゲットが見つからない

エラー: Target links to keplerscript-2 but the target was not found 修正: cxx/CMakeLists.txtで次の変更を行います。

C++20の機能がサポートされない

エラー: C++20 features not supported 修正: CMake 3.22以降と、C++20互換コンパイラ(GCC 10以降、Clang 12以降)を使用します。

Metroバンドラーのエラー

Cannot find module ‘@react-native/babel-preset’

修正:

Unable to resolve module

修正:

Jestとテストに関するエラー

SyntaxError: Cannot use import statement outside a module(プラットフォームパッケージ)

原因:@amazon-devices/react-native-kepler@4.0.0では、jestのセットアップでESモジュールが使用されています。 修正: jest.configで、transformIgnorePatternsに次のパターンを追加します。

Cannot read properties of undefined(Dimensions/PixelRatio/StyleSheet)

原因: React 19でモックの動作が変更されました。これらのAPIにはモックが用意されていません。 修正: jest.setup.jsにモックを追加します(手順7.2を参照)。

Can’t access .root on unmounted test renderer

原因: @testing-library/react-nativeのrender()がReactTestRenderer.act()でラップされています。 修正: act()によるラッピングを削除します。これはテストライブラリによって内部で処理されます(手順7.4を参照)。

NativeAnimatedModuleのメソッドスタブがない

エラー: Cannot read properties of undefined (reading 'apply')(NativeAnimatedHelper.js内) 原因: RN 0.83のアニメーションシステムでは、NativeAnimatedModuleの特定の23個のメソッドが呼び出されます。 修正: jest.setup.jsに完全なモックを追加します(手順7.2を参照)。

ナビゲーションスタックのタイマーがリークする

エラー: You are trying to import a file after the Jest environment has been torn down 修正:

keplerscript-native-ui-componentsにreact-nativeが入れ子になっている

エラー: keplerscript-native-ui-components/node_modules/react-nativeからのフロー/ESM解析エラー 原因:kepler-ui-components@2.xにはreact-nativeの独自のコピーがバンドルされています。 修正: @amazon-devices/kepler-ui-components@3.0.0にアップデートします。

実行時のエラー

Failed to load runtime module: IKeplerScript_2_0

原因:manifest.tomlで、以前のKepler 2.xランタイムが参照されています。 修正: manifest.tomlのruntime-moduleのパスを更新します(手順4を参照)。

Cannot find module ‘@amazon-devices/keplerscript-commonmodules’

修正: devDependenciesに以下を追加します。

Unrecognized command build-kepler

原因:@react-native-community/cliが削除されています。 修正: devDependenciesに以下を追加します。

ReferenceError: useState is not defined

修正: 明示的なインポートを追加します。
最終更新日 2026年10月26日