相关疑难解决方法(0)

升级到 Ionic 5 后,TypeScript 编译中缺少 src/zone-flags.ts

我通过这两个命令升级了我的 Ionic 4 应用程序:

# Upgrading to Ionic 5
npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save

# Upgrading to Angular 9
ng update @angular/core @angular/cli
Run Code Online (Sandbox Code Playgroud)

当我这样做时ionic serve,我开始收到此错误:

> ng run app:serve --host=localhost --port=8100
[ng] chunk {} 0.js, 0.js.map () 22.1 kB  [rendered]
[ng] chunk {common} common.js, common.js.map (common) 25.7 kB  [rendered]
[ng] 
[ng] ERROR in ./src/zone-flags.ts
[ng] Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
[ng] Error: /Users/shashank/Projects/my-app/mobile-app/src/zone-flags.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via …
Run Code Online (Sandbox Code Playgroud)

node.js typescript ionic-framework angular

20
推荐指数
1
解决办法
4254
查看次数

Angular JIT 编译失败:“@angular/compiler”未加载

Angular JIT 编译失败:“@angular/compiler”未加载!

  • 对于生产用例,不鼓励使用 JIT 编译!请考虑使用 AOT 模式。
  • 您是否使用“@angular/platform-b​​rowser-dynamic”或“@angular/platform-server”进行引导?
  • 或者为编译器提供 'import "@angular/compiler";' 在引导之前。

在开发模式下构建生产构建时出现此错误,但没有出现任何错误

angular-material angular ionic5

3
推荐指数
1
解决办法
2万
查看次数