Uncaught TypeError core.InjectionToken не является конструктором в Angular 9 - PullRequest
0 голосов
/ 02 марта 2020

Я перешел с angular 4.2 на 9.0 вместе с узлом, у меня есть NodeJS 12.16v и Angular 9.0. Когда я нажимаю npm start, я получаю эти ошибки.

animation_builder.ts:14 Uncaught TypeError: Cannot read property 'Injectable' of undefined
at animation_builder.ts:14
at animation_builder.ts:37
at platform-browser-animations.umd.js:10
at platform-browser-animations.umd.js:11

и

test_bed_common.ts:28 Uncaught TypeError: core.InjectionToken is not a constructor
at test_bed_common.ts:28
at core-testing.umd.js:10
at core-testing.umd.js:11

Я импортировал эти модули в индекс. html

<script src="node_modules/@angular/animations/bundles/animations.umd.js"></script>
<script src="node_modules/@angular/platform-browser/bundles/platform-browser-animations.umd.js"></script>

После отладки я узнал, что ошибки были в test_bed_component.ts

new InjectionToken<boolean[]>('ComponentFixtureAutoDetect');
...