我尝试使用 ionic 构建一个 pwa 应用程序,当我运行"离子构建"时,一切正常。但是当我运行"离子构建--prod"时,会返回此错误:
node_modules/ionic-angular/umd/components/picker/picker-component.d.ts.PickerCmp.html(13,71( 中的错误:预期 0 个参数,但得到 1。 node_modules/ionic-angular/umd/components/input/input.d.ts.TextInput.html(1,928(:预期参数为 0,但得到 1。 node_modules/ionic-angular/umd/components/input/input.d.ts.TextInput.html(1,961(:预期有 0 个参数,但得到 1。
你应该卸载离子角
npm uninstall ionic-angular
然后将所有导入的导入从离子角替换为@ionic/角
npm uninstall ionic-angular
然后在所有导入中替换"@ionic/角度"。
您可能在"@ionic/角度"中找不到ViewController - 因此不要依赖它。
我在 Angular 8 和使用 iOnic 4 时遇到了这个问题。
它在 Angular 7 上工作正常 - 没有更改相同版本的离子版本。
使用命令检查您的离子版本
-离子信息