nativescript-schematics icon indicating copy to clipboard operation
nativescript-schematics copied to clipboard

migrate-component: 10.1.0 gives error, 10.0.2 does not. Only 10.0.2 available in github...

Open patricknee opened this issue 5 years ago • 0 comments

Environment Provide the content of the package.json file in the project:

Describe the bug Converting an old project started in Angular 6 to shared Angular 10 project. The problem DID NOT occur when I created a new Angular 10 project.

ng add @nativescript/schematics --skipAutoGeneratedComponent <= works fine

Converting first component "home" with migrate component fails:

ng g migrate-component --name=home --dryRun=true --project=web-mobile HomeComponent import found in its module at: ./public/home/home.component HomeComponent file found at: src/app/public/home/home.component.ts ComponentInfo { "className": "HomeComponent", "modulePath": "src/app/app.module.ts", "componentPath": "src/app/public/home/home.component.ts", "componentHtmlPath": "src/app/public/home/home.component.html", "componentStylePath": "src/app/public/home/home.component.scss" } Adding {N} files Adding {N} StyleSheet Cannot read property 'kind' of undefined

Cloning git and running through a debugger, I found that it works with the github version. "Maybe I am behind a version" I thought, but GitHub has 10.0.2 (while I have 10.1.0 installed globally).

I uninstalled the global 10.1.0 version and ran:

npm uninstall @nativescript/schematics npm i @nativescript/[email protected]

ng g migrate-component --name=home nsconfig not found, using .tns as a default extension for NativeScript files HomeComponent import found in its module at: ./public/home/home.component HomeComponent file found at: src/app/public/home/home.component.ts ComponentInfo { "className": "HomeComponent", "modulePath": "src/app/app.module.ts", "componentPath": "src/app/public/home/home.component.ts", "componentHtmlPath": "src/app/public/home/home.component.html", "componentStylePath": "src/app/public/home/home.component.scss" } Adding {N} files Adding {N} StyleSheet CREATE src/app/public/home/home.component.tns.html (15290 bytes) CREATE src/app/public/home/home.component.tns.scss (147 bytes) UPDATE src/app/app.module.tns.ts (856 bytes)

Success

To Reproduce Unable to reproduce on a new project, only on this project migrated through every angular version from Angular 6 onward.

Expected behavior Should migrate component.

Sample project

Additional context

As I cannot get the code for 10.1.0 I am unable to debug. Be aware there is a bug somewhere.

patricknee avatar Sep 23 '20 15:09 patricknee