This issue impacts 9.0.0-rc.0 and happened while updating https://github.com/vmware/clarity.
The following migration failed while running, interrupting the update process.
> Undecorated classes with DI migration.
As of Angular 9, it is no longer supported to use Angular DI on a class that does not have an Angular decorator.
Read more about this here: https://v9.angular.io/guide/migration-undecorated-classes
This migration uses the Angular compiler internally and therefore projects that no longer build successfully after the update cannot run the migration. Please ensure there are no AOT compilation errors and rerun the migration.. The following project failed: src/clr-angular/tsconfig.prod.json
Error: error TS100: Cannot determine the module for class ButtonViewTestComponent in D:/sandbox/clarity/src/clr-angular/button/button-group/button.spec.ts! Add ButtonViewTestComponent to the NgModule to fix it.
Cannot determine the module for class TestIndex in D:/sandbox/clarity/src/clr-angular/emphasis/alert/alerts-pager.spec.ts! Add TestIndex to the NgModule to fix it.
Cannot determine the module for class TestInstance in D:/sandbox/clarity/src/clr-angular/emphasis/alert/alerts-pager.spec.ts! Add TestInstance to the NgModule to fix it.
Cannot determine the module for class BasicWizardTestComponent in D:/sandbox/clarity/src/clr-angular/wizard/test-components/basic-wizard.mock.ts! Add BasicWizardTestComponent to the NgModule to fix it.
Cannot determine the module for class HeaderActionsTestComponent in D:/sandbox/clarity/src/clr-angular/wizard/test-components/header-action-wizard.mock.ts! Add HeaderActionsTestComponent to the NgModule to fix it.
Cannot determine the module for class TemplateApiWizardTestComponent in D:/sandbox/clarity/src/clr-angular/wizard/test-components/api-wizard.mock.ts! Add TemplateApiWizardTestComponent to the NgModule to fix it.
Cannot determine the module for class DynamicWizardTestComponent in D:/sandbox/clarity/src/clr-angular/wizard/test-components/dynamic-wizard.mock.ts! Add DynamicWizardTestComponent to the NgModule to fix it.
Cannot determine the module for class UnopenedWizardTestComponent in D:/sandbox/clarity/src/clr-angular/wizard/test-components/unopened-wizard.mock.ts! Add UnopenedWizardTestComponent to the NgModule to fix it.
Cannot read property 'kind' of undefined
git HEAD was at ef1733759ceeff88ceb7ab7ff01f5da604fb79cb before migrations.
脳 Migration failed. See above for further details.
The kind of undefined error surfaces due to #16035. All of the migrations make the assumption that the tsconfig files are valid. This is no longer the case due to the CLI migration failure.
I'll fix this in the framework migrations, as apparently it cannot assume that the tsconfig is always valid.
@devversion also mentioned that this can happen when test files are included, which happens in library project because the tsconfigs used by ng-packagr automatically filter out spec files. Maybe we should update these configs to exclude the test files.
Could this be related https://github.com/angular/angular/issues/33143 got this error 20 days ago
(nit: after moving from single-app to monorepo ( multi projects/ in workspace) I don't have this error anymore)
I'm not sure if that is related. This issue seems to be because of #16035 where program.getSourceFile() returns undefined. The other issue you linked to seems to originate from the AngularCompilerProgram. I'd love to investigate this, but I'm not sure how I can reproduce this.
Assigning to Filipe for verification
For reference: The error is no longer thrown as part of the migration and we now gracefully report if the tsconfig of a migration target has failures. I think the CLI migration that generates these invalid tsonfigs has been fixed, so I think that can be closed.
I can confirm Cannot read property 'kind' of undefined is no longer shown on that update.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._