0

Everything was fine before I updated nativescript core modules.

Now I'm getting some errors

ERROR in ./app/routes/user/login/login.component.ts
Module not found: Error: Can't resolve 'nativescript-ios-uuid' in '/Users/.../src/app/routes/user/login'
 @ ./app/routes/user/login/login.component.ts 67:29-61
 @ ./app/routes/user/user.module.ts
 @ ../$$_lazy_route_resource lazy namespace object
 @ ../node_modules/@angular/core/fesm5/core.js
 @ ./app/app.module.ts
 @ ./main.ts

ERROR in node_modules/@types/jest/index.d.ts(39,22): error TS1005: ';' expected.
node_modules/@types/jest/index.d.ts(39,46): error TS1005: ',' expected.
node_modules/@types/jest/index.d.ts(220,81): error TS1144: '{' or ';' expected.
node_modules/@types/jest/index.d.ts(220,161): error TS1005: '(' expected.
node_modules/@types/jest/index.d.ts(220,168): error TS1005: ')' expected.

After the update (I also updated nativescript) which ask me to migreate to webpack.

After I saw that errors, I tried some fixes without luck so I remove all the references to nativescript-ios-uuid just in case... But the error keeps appearing, though I remove it from login.ts

So why is that webpack is not refreshing the changes I did? Also about jest, I updated to the new version and still have the same issue.

My package.json:

{
  "nativescript": {
    "id": "com.company.app",
    "tns-android": {
      "version": "5.4.0"
    },
    "tns-ios": {
      "version": "5.4.1"
    }
  },
  "description": "my name",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "scripts": {
    "lint": "tslint \"src/**/*.ts\""
  },
  "dependencies": {
    "@angular/animations": "~6.1.0",
    "@angular/common": "~6.1.0",
    "@angular/compiler": "~6.1.0",
    "@angular/core": "~6.1.0",
    "@angular/forms": "~6.1.0",
    "@angular/http": "~6.1.0",
    "@angular/platform-browser": "~6.1.0",
    "@angular/platform-browser-dynamic": "~6.1.0",
    "@angular/router": "~6.1.0",
    "angular-font-awesome": "^3.1.2",
    "base-64": "^0.1.0",
    "cordova-support-google-services": "^1.3.1",
    "font-awesome": "^4.7.0",
    "nativescript-angular": "~6.2.0",
    "nativescript-bitmap-factory": "^1.7.1",
    "nativescript-fontawesome": "^1.0.0",
    "nativescript-localstorage": "^2.0.0",
    "nativescript-ng2-fonticon": "^1.3.4",
    "nativescript-open-app": "^0.2.0",
    "nativescript-permissions": "^1.2.3",
    "nativescript-platform-css": "^1.6.6",
    "nativescript-plugin-firebase": "^7.7.0",
    "nativescript-social-share": "^1.5.1",
    "nativescript-telephony": "^1.0.4",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-toasty": "^1.3.1",
    "nativescript-ui-sidedrawer": "~5.0.0",
    "nativescript-version-number": "^1.1.0",
    "reflect-metadata": "~0.1.10",
    "rxjs": "~6.2.0",
    "tns-core-modules": "^5.4.2",
    "utf8": "^3.0.0",
    "zone.js": "~0.8.18"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~6.1.0",
    "@nativescript/schematics": "~0.3.0",
    "@ngtools/webpack": "~6.2.0",
    "@types/jest": "^23.3.14",
    "codelyzer": "~4.5.0",
    "nativescript-dev-sass": "~1.6.0",
    "nativescript-dev-typescript": "~0.7.0",
    "nativescript-dev-webpack": "0.24.1",
    "tslint": "~5.11.0",
    "typescript": "~2.7.2"
  },
  "readme": "NativeScript Application",
  "author": "me"
}

tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true,
        "lib": [
            "es6",
            "dom",
            "es2015.iterable"
        ],
        "baseUrl": ".",
        "paths": {
            "~/*": [
                "src/*"
            ],
            "*": [
                "./node_modules/tns-core-modules/*",
                "./node_modules/*"
            ]
        }
    },
    "exclude": [
        "node_modules",
        "platforms"
    ]
}

--- Stacktrace after suggestions:

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company.app/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: 
Calling js method onCreate failed

Error: Could not resolve app.component.html. Looked for: /data/data/com.companu.app/files/app/app.component.html.
File: "file:///data/data/com.company.app/files/app/vendor.js, line: 66971, column: 12

StackTrace: 
    Frame: function:'ZoneAwareError', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 70628, column: 33
    Frame: function:'push.../node_modules/nativescript-angular/resource-loader.js.FileSystemResourceLoader.resolve', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66971, column: 19
    Frame: function:'push.../node_modules/nativescript-angular/resource-loader.js.FileSystemResourceLoader.get', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66957, column: 33
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer._fetch', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 10524, column: 43
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer._preParseTemplate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 10563, column: 29
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer.normalizeTemplate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 10551, column: 36
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.loadDirectiveMetadata', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 18464, column: 58
    Frame: function:'', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 32017, column: 55
    Frame: function:'', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 32016, column: 72
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._loadModules', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 32013, column: 75
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 31991, column: 36
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 31951, column: 37
    Frame: function:'push.../node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.CompilerImpl.compileModuleAsync', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 51992, column: 31
    Frame: function:'push.../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 37433, column: 25
    Frame: function:'_bootstrapper', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66092, column: 35
    Frame: function:'', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66155, column: 19
    Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 93895, column: 23
    Frame: function:'notifyLaunch', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 112261, column: 17
    Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 112183, column: 28
    Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 112032, column: 14
    Frame: function:'push.../node_modules/tns-core-modules/ui/frame/activity.js.NativeScriptActivity.onCreate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 109846, column: 25


    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: com.tns.NativeScriptException: 
Calling js method onCreate failed

Error: Could not resolve app.component.html. Looked for: /data/data/com.company.app/files/app/app.component.html.
File: "file:///data/data/com.company.app/files/app/vendor.js, line: 66971, column: 12

StackTrace: 
    Frame: function:'ZoneAwareError', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 70628, column: 33
    Frame: function:'push.../node_modules/nativescript-angular/resource-loader.js.FileSystemResourceLoader.resolve', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66971, column: 19
    Frame: function:'push.../node_modules/nativescript-angular/resource-loader.js.FileSystemResourceLoader.get', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66957, column: 33
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer._fetch', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 10524, column: 43
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer._preParseTemplate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 10563, column: 29
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer.normalizeTemplate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 10551, column: 36
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.loadDirectiveMetadata', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 18464, column: 58
    Frame: function:'', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 32017, column: 55
    Frame: function:'', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 32016, column: 72
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._loadModules', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 32013, column: 75
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 31991, column: 36
    Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 31951, column: 37
    Frame: function:'push.../node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.CompilerImpl.compileModuleAsync', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 51992, column: 31
    Frame: function:'push.../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 37433, column: 25
    Frame: function:'_bootstrapper', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66092, column: 35
    Frame: function:'', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 66155, column: 19
    Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 93895, column: 23
    Frame: function:'notifyLaunch', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 112261, column: 17
    Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 112183, column: 28
    Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 112032, column: 14
    Frame: function:'push.../node_modules/tns-core-modules/ui/frame/activity.js.NativeScriptActivity.onCreate', file:'file:///data/data/com.company.app/files/app/vendor.js', line: 109846, column: 25


    at com.tns.Runtime.callJSMethodNative(Native Method)
    at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)
    at com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)
    at com.tns.Runtime.callJSMethod(Runtime.java:1070)
    at com.tns.Runtime.callJSMethod(Runtime.java:1050)
    at com.tns.Runtime.callJSMethod(Runtime.java:1042)
    at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19)
    at android.app.Activity.performCreate(Activity.java:6975)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
    ... 9 more
skyboyer
  • 22,209
  • 7
  • 57
  • 64
Faabass
  • 1,394
  • 8
  • 29
  • 58
  • Initially I too had wired issues with HMR and eventually it's resolved. Did you try running a clean build just in case? – Manoj Jun 12 '19 at 20:18
  • When you mean clean build you mean `tns build android --clean` ? – Faabass Jun 12 '19 at 20:19
  • I thought you must be using `tns run` since you mentioned about refreshing webpack. Either ways you could do `tns platform clean android` and run / build the app again. – Manoj Jun 12 '19 at 20:25
  • no.. same error.. Also the app is freeze in the splash screen but no other error in the log – Faabass Jun 12 '19 at 20:38
  • After updating webpack did you run `./node_modules/.bin/update-ns-webpack --deps --configs` ? – Narendra Jun 13 '19 at 01:13
  • @Narendra I execute that right now, but it didn't work. I added the complete stracktrace in case it helps – Faabass Jun 13 '19 at 01:52
  • Can you please tell me where is your `app.component.html` is located? is it inside `app` folder or do your have `src` folder as well? – Narendra Jun 13 '19 at 01:54
  • Yes.. the path is ok. It’s to weird for me... – Faabass Jun 13 '19 at 01:55
  • and your platform says 5.4.0 for android. DId you update that as well? 5.4.2 – Narendra Jun 13 '19 at 02:00
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/194849/discussion-between-narendra-and-faabass). – Narendra Jun 13 '19 at 02:04

0 Answers0