Skip to content

Unable to build NativeScript 5.4 application with nativescript-angular 8.0.2 #1914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue Jul 22, 2019 · 4 comments
Assignees
Labels

Comments

@rosen-vladimirov
Copy link

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.4.2
  • Cross-platform modules: 5.4.3
  • Android Runtime: 5.4.0
  • iOS Runtime: 5.4.2
  • Plugin(s):
{
  "nativescript": {
    "id": "org.nativescript.appNg54",
    "tns-android": {
      "version": "5.4.0"
    },
    "tns-ios": {
      "version": "5.4.2"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "~8.0.0",
    "@angular/common": "~8.0.0",
    "@angular/compiler": "~8.0.0",
    "@angular/core": "~8.0.0",
    "@angular/forms": "~8.0.0",
    "@angular/http": "~8.0.0-beta.10",
    "@angular/platform-browser": "~8.0.0",
    "@angular/platform-browser-dynamic": "~8.0.0",
    "@angular/router": "~8.0.0",
    "nativescript-angular": "~8.0.0",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~6.5.0",
    "tns-core-modules": "~5.4.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~8.0.0",
    "@ngtools/webpack": "~8.0.0",
    "nativescript": "^5.4.2",
    "nativescript-dev-typescript": "~0.10.0",
    "nativescript-dev-webpack": "~0.24.0"
  },
  "gitHead": "8c1a4866a66daab09bf5ef8e5a96472687192373",
  "readme": "NativeScript Application"
}
  • NativeScript-Angular: 8.0.2
  • Angular: 8

Describe the bug
When trying to build NativeScript application created with 5.4, the application suddenly failed to build. In package.json of the project, the nativescript-angular is referenced with ~8.0.0, which suddenly installed 8.0.2 of the package. After trying to build the application (with bundle workflow) an error occured:
tns build android:

ERROR in ../node_modules/nativescript-angular/element-registry.js
Module not found: Error: Can't resolve 'tns-core-modules/ui/bottom-navigation' in 'D:\Work\nativescript-cli\scratch\appNg54\node_modules\nativescript-angular'
 @ ../node_modules/nativescript-angular/element-registry.js 142:57-105
 @ ../node_modules/nativescript-angular/renderer.js
 @ ../node_modules/nativescript-angular/nativescript.module.js
 @ ./app/app.module.ts
 @ ./main.ts

ERROR in ../node_modules/nativescript-angular/element-registry.js
Module not found: Error: Can't resolve 'tns-core-modules/ui/tab-navigation-base/tab-content-item' in 'D:\Work\nativescript-cli\scratch\appNg54\node_modules\nativescript-angular'
 @ ../node_modules/nativescript-angular/element-registry.js 172:55-122
 @ ../node_modules/nativescript-angular/renderer.js
 @ ../node_modules/nativescript-angular/nativescript.module.js
 @ ./app/app.module.ts
 @ ./main.ts

ERROR in ../node_modules/nativescript-angular/element-registry.js
Module not found: Error: Can't resolve 'tns-core-modules/ui/tab-navigation-base/tab-strip' in 'D:\Work\nativescript-cli\scratch\appNg54\node_modules\nativescript-angular'
 @ ../node_modules/nativescript-angular/element-registry.js 170:49-109
 @ ../node_modules/nativescript-angular/renderer.js
 @ ../node_modules/nativescript-angular/nativescript.module.js
 @ ./app/app.module.ts
 @ ./main.ts

ERROR in ../node_modules/nativescript-angular/element-registry.js
Module not found: Error: Can't resolve 'tns-core-modules/ui/tab-navigation-base/tab-strip-item' in 'D:\Work\nativescript-cli\scratch\appNg54\node_modules\nativescript-angular'
 @ ../node_modules/nativescript-angular/element-registry.js 171:53-118
 @ ../node_modules/nativescript-angular/renderer.js
 @ ../node_modules/nativescript-angular/nativescript.module.js
 @ ./app/app.module.ts
 @ ./main.ts

ERROR in ../node_modules/nativescript-angular/element-registry.js
Module not found: Error: Can't resolve 'tns-core-modules/ui/tabs' in 'D:\Work\nativescript-cli\scratch\appNg54\node_modules\nativescript-angular'
 @ ../node_modules/nativescript-angular/element-registry.js 173:45-80
 @ ../node_modules/nativescript-angular/renderer.js
 @ ../node_modules/nativescript-angular/nativescript.module.js
 @ ./app/app.module.ts
 @ ./main.ts
Webpack compilation complete.
Executing webpack failed with exit code 2.

To Reproduce

  1. Install nativescript CLI 5.4.x: npm i -g [email protected]
  2. Create new application with the currently installed CLI: tns create myApp --ng
  3. Try to build the application: cd myApp && tns build android
    The build will fail.

Expected behavior
Patch version of the package should not break existing applications.

Workaround:
Hardcode version 8.0.1 of nativescript-angular in the project's package.json:

npm i --save --save-exact [email protected]
@erkanarslan
Copy link

This still exists in NS 5.4.

@VladimirAmiorkov
Copy link
Contributor

Can you give us more details on what versions of the packages and NativeScript you are using in the project which has this issue. On our end this issue has been resolved

@erkanarslan
Copy link

erkanarslan commented Oct 10, 2019

Nativescript 5.4.0
android version : 5.4.0
ios-version: 5.4.2

"dependencies": {
    "@angular/animations": "~8.0.0",
    "@angular/common": "~8.0.0",
    "@angular/compiler": "~8.0.0",
    "@angular/core": "~8.0.0",
    "@angular/forms": "~8.0.0",
    "@angular/http": "~8.0.0-beta.10",
    "@angular/platform-browser": "~8.0.0",
    "@angular/platform-browser-dynamic": "~8.0.0",
    "@angular/router": "~8.0.0",
    "nativescript-angular": "8.0.1",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~6.5.0",
    "tns-core-modules": "~5.4.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~8.0.0",
    "@ngtools/webpack": "~8.0.0",
    "codelyzer": "~4.5.0",
    "nativescript-dev-sass": "~1.7.0",
    "nativescript-dev-typescript": "~0.10.0",
    "nativescript-dev-webpack": "~0.24.0",
    "tslint": "~5.11.0"
  }

I set the angular version to 8.0.1 as a work around but it was ~8.0.0 just like the others.

@VladimirAmiorkov
Copy link
Contributor

Can you give is the error you get? Is it a runtime error or a build error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants