NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

JS ERROR Error: A Frame must be used to navigate to a Page #411

Closed GrEg00z closed 6 years ago

GrEg00z commented 6 years ago

I still have this issue, for iOS webpack build only (I didn't try on Android)

See #327 (not real solution given in this post)

I've switch from nativescript-webpack 0.8.0 to 0.9.0, and follow explanation to the letter here

But when I run tns run ios --bundle, then I get this error right after app starting : JS ERROR Error: A Frame must be used to navigate to a Page

When I launch tns run ios, it works correctly

tns info :

┌──────────────────┬─────────────────┬────────────────┬──────────────────┐
│ Component        │ Current version │ Latest version │ Information      │
│ nativescript     │ 3.4.1           │ 3.4.1          │ Up to date       │
│ tns-core-modules │ 3.4.0           │ 3.4.0          │ Up to date       │
│ tns-android      │ 3.3.1           │ 3.4.1          │ Update available │
│ tns-ios          │ 3.4.1           │ 3.4.1          │ Up to date       │
└──────────────────┴─────────────────┴────────────────┴──────────────────┘

Here is error stacktrace in Xcode console :

 ***** Fatal JavaScript exception - application has been terminated. *****
 Native stack trace:
 1   0x101b30608 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
1   0x101b30608 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
 2   0x10237d398 ffi_closure_SYSV_inner
2   0x10237d398 ffi_closure_SYSV_inner
 3   0x1023801b4 .Ldo_closure
3   0x1023801b4 .Ldo_closure
 4   0x190dcd5f4 <redacted>
4   0x190dcd5f4 <redacted>
 5   0x190dccd08 <redacted>
5   0x190dccd08 <redacted>
 6   0x190dcca84 <redacted>
6   0x190dcca84 <redacted>
 7   0x190e3b7a8 <redacted>
7   0x190e3b7a8 <redacted>
 8   0x190d1095c _CFXNotificationPost
8   0x190d1095c _CFXNotificationPost
 9   0x191823970 <redacted>
9   0x191823970 <redacted>
 10  0x1971e24b4 <redacted>
10  0x1971e24b4 <redacted>
 11  0x1971e7e24 <redacted>
11  0x1971e7e24 <redacted>
 12  0x1971fc8b0 <redacted>
12  0x1971fc8b0 <redacted>
 13  0x1971e50b8 <redacted>
13  0x1971e50b8 <redacted>
 14  0x1929dc884 <redacted>
14  0x1929dc884 <redacted>
 15  0x1929dc6f0 <redacted>
15  0x1929dc6f0 <redacted>
 16  0x1929dcaa0 <redacted>
16  0x1929dcaa0 <redacted>
 17  0x190de142c <redacted>
17  0x190de142c <redacted>
 18  0x190de0d9c <redacted>
18  0x190de0d9c <redacted>
 19  0x190dde9a8 <redacted>
19  0x190dde9a8 <redacted>
 20  0x190d0eda4 CFRunLoopRunSpecific
20  0x190d0eda4 CFRunLoopRunSpecific
 21  0x196fcefc8 <redacted>
21  0x196fcefc8 <redacted>
 22  0x196fc9c9c UIApplicationMain
22  0x196fc9c9c UIApplicationMain
 23  0x102380044 ffi_call_SYSV
23  0x102380044 ffi_call_SYSV
 24  0x10237cee0 ffi_call_int
24  0x10237cee0 ffi_call_int
 25  0x10237c9f0 ffi_call
25  0x10237c9f0 ffi_call
 26  0x101af1b10 NativeScript::FFICall::call(JSC::ExecState*)
26  0x101af1b10 NativeScript::FFICall::call(JSC::ExecState*)
 27  0x1020f60f8 JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
27  0x1020f60f8 JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
 28  0x1020fe6e8 llint_entry
28  0x1020fe6e8 llint_entry
 29  0x1020fe6f8 llint_entry
29  0x1020fe6f8 llint_entry
 30  0x1020fe6f8 llint_entry
30  0x1020fe6f8 llint_entry
 31  0x1020fe6f8 llint_entry
31  0x1020fe6f8 llint_entry
 JavaScript stack trace:
 1   createRootView@file:///app/bundle.js:7501:75
 2   didFinishLaunchingWithOptions@file:///app/bundle.js:7422:38
 3   @[native code]
 4   onReceive@file:///app/bundle.js:7356:32
 5   UIApplicationMain@[native code]
 6   start@file:///app/vendor.js:29587:26
 7   bootstrapApp@file:///app/vendor.js:65387:28
 8   bootstrapModule@file:///app/vendor.js:65373:26
 9   @file:///app/bundle.js:55319:57
 10  __webpack_require__@file:///app/vendor.js:53:34
 11  webpackJsonpCallback@file:///app/vendor.js:25:42
 12  anonymous@file:///app/bundle.js:2:13
 13  evaluate@[native code]
 14  moduleEvaluation@[native code]
 16  promiseReactionJob@[native code]
  require@[native code]
  anonymous@file:///app/starter.js:2:8
 19  evaluate@[native code]
 20  moduleEvaluation@[native code]
 21  @[native code]
 22  promiseReactionJob@[native code]
 JavaScript error:
 file:///app/bundle.js:7501:75: JS ERROR Error: A Frame must be used to navigate to a Page.

file:///app/bundle.js:7501:75: JS ERROR Error: A Frame must be used to navigate to a Page.

Here is my webpack.config.js :

{
  "description": "My Application desc",
  "license": "My app name",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.myAppName",
    "tns-android": {
      "version": "3.3.1"
    },
    "tns-ios": {
      "version": "3.4.1"
    }
  },
  "dependencies": {
    "@angular/animations": "~5.0.0",
    "@angular/common": "~5.0.0",
    "@angular/compiler": "~5.0.0",
    "@angular/core": "~5.0.0",
    "@angular/forms": "~5.0.0",
    "@angular/http": "~5.0.0",
    "@angular/platform-browser": "~5.0.0",
    "@angular/platform-browser-dynamic": "~5.0.0",
    "@angular/router": "~5.0.0",
    "nativescript-angular": "^5.0.0",
    "nativescript-bluetooth": "^1.1.6",
    "nativescript-clipboard": "^1.1.7",
    "nativescript-drop-down": "^3.1.1",
    "nativescript-exit": "^1.0.1",
    "nativescript-gcloud": "file:../plugins/nativescript-gcloud",
    "nativescript-iqkeyboardmanager": "^1.1.0",
    "nativescript-loading-indicator": "^2.3.2",
    "nativescript-permissions": "^1.2.3",
    "nativescript-plugin-firebase": "^5.0.2",
    "nativescript-pro-ui": "^3.3.0",
    "nativescript-texttospeech": "^1.3.2",
    "nativescript-theme-core": "~1.0.2",
    "nativescript-vibrate": "^2.0.1",
    "ng2-translate": "^5.0.0",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^5.5.0",
    "tns-core-modules": "^3.4.0",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~5.0.0",
    "@ngtools/webpack": "~1.8.2",
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "copy-webpack-plugin": "~4.0.1",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.0",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-sass": "^1.3.5",
    "nativescript-dev-typescript": "^0.6.0",
    "nativescript-dev-webpack": "^0.9.0",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.1.0",
    "sass-loader": "~6.0.6",
    "tns-platform-declarations": "^3.2.0",
    "typescript": "~2.4.2",
    "webpack": "~3.8.1",
    "webpack-bundle-analyzer": "^2.8.2",
    "webpack-sources": "~1.0.1"
  }
}

tsconfig.json :

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true,
        "lib": [
            "es6",
            "dom",
            "es2015.iterable"
        ],
        "baseUrl": ".",
        "paths": {
            "*": [
                "./node_modules/tns-core-modules/*",
                "./node_modules/*"
            ]
        }
    },
    "exclude": [
        "node_modules",
        "platforms",
        "**/*.aot.ts"
    ]
}
GrEg00z commented 6 years ago

Anybody help !! :(

GrEg00z commented 6 years ago

Is there still support in this repo ? No choice to downgrade webpack to 0.8.0 .... 👎

sis0k0 commented 6 years ago

Hey @GrEg00z, can't seem to reproduce it with the provided package.json and tsconfig.json. Can you send an app with the issue or ping me on slack for more information?

GrEg00z commented 6 years ago

Hello @sis0k0 , I want to try to create an empty nativescript/angular project, and check if bundle works correctly.

How can I ping you on slack ? I'm using slack but dont really know how to do it

sis0k0 commented 6 years ago

I'm @sis0k0 in nativescriptcommunity.slack.com.

GrEg00z commented 6 years ago

Ok I think you need to add me on slack, because I cant acces to it. My email : jakubowicz.gregory@gmail.com

I've just created an empty nativescript project, with tns create myAppName --ng When I try to do tns run ios, all seems OK except that tns command stop right after "Refreshing application.." build step . No error thrown, it's just cut the running proccess of tns run, without say anything. App is installed correctly, and also works.

Can you confirm that you don't have this problem when reproduce my steps ? I'm using macOS Sierra 10.12.6

I suspect my osx environnement to be in cause...

GrEg00z commented 6 years ago

Well, after reinstall Xcode, and also all required tools by nativescript ios (script used), I finaly make it works normally, while using tns run ios.

And good new, tns run ios --bundle works also good (but for the empty nativescript project only)

In fact, I've still have the same problem for my project :( I really tried everything, like delete node_modules folder, delete platform folder, etc... Still the same

So when I'll have free time, I will switch to the empty project repository, and put my code inside it.

If I find why this problem occurs on old nativescript version, I let you know

sis0k0 commented 6 years ago

Hey @GrEg00z, I'll close this issue for now. If you're not in the {N} community slack, you can ping me in twitter (@StanimiraVlaeva) or send me a mail at stanimira.vlaeva@progress and we can debug your app.