我已将Angular 8 应用程序更新为 Angular 9。一切运行良好,如果我使用 启动应用程序ng serve
,但如果我使用 启动应用程序ng serve --prod
,我会在运行时收到以下错误:
ReferenceError: SomeAbstractModelClass is not defined at http://localhost:4200/main.js:1:330907 at Module.zUnb (http://localhost:4200/main.js:1:331001) at l (http://localhost:4200/runtime.js:1:552) at Object.0 (http://localhost:4200/main.js:1:96) at l (http://localhost:4200/runtime.js:1:552) at t (http://localhost:4200/runtime.js:1:421) at Array.r [as push] (http://localhost:4200/runtime.js:1:293) at http://localhost:4200/main.js:1:47
我不知道问题可能是什么,因为所有内容都带有一些警告。
WARNING in .../projects/apps/editor/src/test.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig.
我还尝试禁用常春藤。:
"angularCompilerOptions": {
"enableIvy": false
}
然后我收到以下错误消息:
ReferenceError: SomeOtherModelClass is not defined at http://localhost:4200/main.js:1:364834 at Module.zUnb (http://localhost:4200/main.js:1:364923) at l (http://localhost:4200/runtime.js:1:552) at Object.0 (http://localhost:4200/main.js:1:96) at l (http://localhost:4200/runtime.js:1:552) at t (http://localhost:4200/runtime.js:1:421) at Array.r [as push] (http://localhost:4200/runtime.js:1:293) at http://localhost:4200/main.js:1:47
SomeOtherModelClass
是扩展另一个抽象类的类。
这个问题的原因可能是什么?如果我能提供更多信息,请告诉我。