英文:
Can't resolve all parameters for setupPlatform: (?, [object Object], [object Object]) error on ionic serve
问题
This error occurred when I run the Ionic project "ionic serve".
Ionic Info:
Ionic:
Ionic CLI: 5.4.13
Ionic Framework: ionic-angular 3.9.9
@ionic/app-scripts: 3.2.4
Cordova:
Cordova CLI: 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms: android 8.1.0
Cordova Plugins: no whitelisted plugins (17 plugins total)
Utility:
cordova-res: not installed
native-run: 0.3.0
System:
NodeJS: v12.14.0 (/usr/local/bin/node)
npm: 6.13.4
OS: macOS Catalina
And this is the complete error message in the console log:
compiler.js:2420 Uncaught Error: Can't resolve all parameters for setupPlatform: (?, [object Object], [object Object]).
at syntaxError (compiler.js:2420)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:21576)
at CompileMetadataResolver._getFactoryMetadata (compiler.js:21475)
at CompileMetadataResolver.getProviderMetadata (compiler.js:21708)
at compiler.js:21638
at Array.forEach (
at CompileMetadataResolver._getProvidersMetadata (compiler.js:21598)
at compiler.js:21220
at Array.forEach (
at CompileMetadataResolver.getNgModuleMetadata (compiler.js:21211)
No clues where and how to find the error.
Any suggestion would help a lot.
英文:
This error occurred when i run ionic project "ionic serve".
Ionic Info:
Ionic:
Ionic CLI : 5.4.13
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : no whitelisted plugins (17 plugins total)
Utility:
cordova-res : not installed
native-run : 0.3.0
System:
NodeJS : v12.14.0 (/usr/local/bin/node)
npm : 6.13.4
OS : macOS Catalina
and this is complete error message in console log
compiler.js:2420 Uncaught Error: Can't resolve all parameters for setupPlatform: (?, [object Object], [object Object]).
at syntaxError (compiler.js:2420)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:21576)
at CompileMetadataResolver._getFactoryMetadata (compiler.js:21475)
at CompileMetadataResolver.getProviderMetadata (compiler.js:21708)
at compiler.js:21638
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getProvidersMetadata (compiler.js:21598)
at compiler.js:21220
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (compiler.js:21211)
no clues where and how to find the error.
Any suggestion would help a lot.
答案1
得分: 1
请提供有关引发此错误的文件的更多详细信息。
根据您提供的有限内容,我可以假设这可能是https://stackoverflow.com/questions/37997824/exception-cant-resolve-all-parameters?rq=1 的一个可能重复的问题。
基本上,该文件无法加载/检测到注入的服务,因此导致了此问题。
要解决此问题,您需要在模块中导入它,或者进行静态注入。
希望这对您有所帮助。
英文:
please provide some more details regarding the file which is throwing this error.
For the limited content which you have provided, I can assumet that this is a possible duplicate of https://stackoverflow.com/questions/37997824/exception-cant-resolve-all-parameters?rq=1
Basically, the file is unable to load/detected the injected service, hence leading to this issue.
To resolve this either you need to import in the module as well, or inject it statically.
Hope this might have helped.
答案2
得分: 0
你可能已经在你的代码中添加了与平台相关的功能,因此它可能无法在浏览器上运行。
尝试在Android或iOS设备上运行相同的代码。
要在Android模拟,请使用以下命令。如果连接了任何Android设备,它也会在设备上安装。
ionic cordova run android
否则,构建并在设备上运行。
ionic cordova build <platform>
(即)平台可以是android或ios。
英文:
You might have added any platform-dependent functionalities to your code. So it may not run on a browser.
Try running the same in Android or iOS Device.
To simulate in Android you can use the below command. If any Android device is connected it will install in it aswell.
ionic cordova run android
Else take a build and run in device
ionic cordova build <platform>
(i.e) platform either android or ios
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论