Skip to content
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

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

Open
patricknee opened this issue Sep 23, 2020 · 0 comments

Comments

@patricknee
Copy link

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.

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

No branches or pull requests

1 participant