NativeScript / NativeScript/NativeScript

TypeError: Cannot read property 'navigate' of undefined

オープン
#9,762 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug-pending-triage
主要言語
TypeScript
スター
25.7k
フォーク
1.7k
平均マージ
1日 5時間
マージ済み PR(30日)
35

説明

Issue Description
<Page loaded="pageLoaded" navigatingTo="onNavigatingTo">
    <StackLayout orientation="vertical">
        <Image src="~/images/apple.jpg" />
        <TextField hint="email address" keyboardType="email" autocorrect="false" autocapitalizationType="none" />
        <TextField hint="password" secure="true" />
        <Button class="bnt" text="sign in" tap="login" />
        <Button text="sign up for goes" tap="navigateToMainPage" />
    </StackLayout>
</Page>
export function navigateToMainPage() {
  Frame.topmost().navigate({
    moduleName: "views/register/register",
    animated: false
  });
}
Reproduction
tns run android --watch
Relevant log output (if applicable)
System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onClick failed
System.err: TypeError: Cannot read property 'navigate' of undefined
System.err:
System.err: StackTrace:
System.err: navigateToMainPage(file: app\webpack:\HelloWorld\app\views\login\login.js:8:15)
System.err:     at _handleEvent(file: app\webpack:\HelloWorld\node_modules\@nativescript\core\data\observable\index.js:233:0)
System.err:     at notify(file: app\webpack:\HelloWorld\node_modules\@nativescript\core\data\observable\index.js:216:0)
System.err:     at _emit(file: app\webpack:\HelloWorld\node_modules\@nativescript\core\data\observable\index.js:256:0)
System.err:     at ClickListenerImpl.onClick(file: app\webpack:\HelloWorld\node_modules\@nativescript\core\ui\button\index.android.js:28:0)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1175)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1153)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1149)
System.err:     at com.tns.gen.java.lang.Object_vendor_16521_28_ClickListenerImpl.onClick(Object_vendor_16521_28_ClickListenerImpl.java:18)
System.err:     at android.view.View.performClick(View.java:7125)
System.err:     at android.view.View.performClickInternal(View.java:7102)
System.err:     at android.view.View.access$3500(View.java:801)
System.err:     at android.view.View$PerformClick.run(View.java:27336)
System.err:     at android.os.Handler.handleCallback(Handler.java:883)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:100)
System.err:     at android.os.Looper.loop(Looper.java:214)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:7356)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Environment

No response

Please accept these terms

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

navigateToMainPage が Frame.topmost().navigate を呼び出している app/views/login/login.js から始めます。tns run android --watch を実行してサインアップボタンの失敗を再現し、その後、関連する NativeScript のナビゲーションエントリポイントを追跡します。ボタンが報告された TypeError をスローせずに register モジュールへ遷移すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, javascript
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。