ユーザ用ツール

サイト用ツール


サイドバー

reactnative:エラー

エラー

[Unhandled promise rejection: Error: The callback provided as parameter 1 is not a function.]

コールバックでtxを参照していないためのエラー。

db.transaction(console.log("callback"), console.log("error"), console.log("success"))
   ↓
db.transaction((tx)=>{console.log("callback")}, console.log("error"), console.log("success"))

TypeError: this state setState undefied

おそらくバインドの問題。bindをするか⇒で書く。

Accessing view manager configs directly off UIManager via UIManager

blob:http://localhos…6-9c681da2d1b3:3574 Accessing view manager configs directly off UIManager via UIManager['AIRMapLite'] is no longer supported. Use UIManager.getViewManagerConfig('AIRMapLite') instead.

警告を非表示にする

How to solved UIManager['AIRMapLite'] is no longer supported. (White Screen with white Logo)

import {YellowBox} from 'react-native';

render() {
  YellowBox.ignoreWarnings(['Warning: ...']);  // <- insert the warning text here you wish to hide. 
  return (
    //cool ui stuff
  );
}

Looking for JS files in

いままで起動できていたのにできなくなった。

Looking for JS files in
   C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts

Loading dependency graph, done.
Error: Unable to resolve module `./index` from `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts/.`: The module `./index` could not be found from `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts/.`. Indeed, none of these files exist:
  * `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
  * `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts\index\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
    at ModuleResolver.resolveDependency (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:163:15)
    at ResolutionRequest.resolveDependency (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\node-haste\DependencyGraph.js:283:16)
    at C:\Users\[User]\react\native_background_timer\node_modules\metro\src\lib\transformHelpers.js:261:42
    at Server.<anonymous> (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\Server.js:1038:41)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\Server.js:99:24)
    at _next (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\Server.js:119:9)
::ffff:127.0.0.1 - - [31/Mar/2019:21:59:04 +0000] "GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-" "okhttp/3.12.1"

Error: Unable to resolve module `./index` from `\node_modules\react-native\scripts/.`: The module `./index` could not be found from `\node_modules\react-native\scripts/.`. Indeed, none of these files exist: #23908

とりあえず、
react-native start -- --reset-cache

react-native run-android
を別コマンドラインで実行すると起動するが、今までどおりにはできない。

対応その1

node_modules\react-native\scripts\launchPackager.bat

:: Copyright (c) Facebook, Inc. and its affiliates.
::
:: This source code is licensed under the MIT license found in the
:: LICENSE file in the root directory of this source tree.

@echo off
title Metro Bundler
call .packager.bat
:: DELETE 
:: node "%~dp0..\cli.js" start //DELETE 

:: ADD 
node "%~dp0..\cli.js" start --projectRoot ../../../ 
pause
exit

対応その2

もしくは
\node_modules\@react-native-community\cli\build\commands\runAndroid\runAndroid.js を編集

const procConfig = {

    // delete this line    
    cwd: scriptsDir

    // add this line
    cwd: process.cwd()
};

対応1で表示された!

reactnative/エラー.txt · 最終更新: 2019/04/02 06:20 by ips