Error: Can't resolve all parameters for setupPlatform: (?, [object Object], [object Object])

 ̄綄美尐妖づ 提交于 2020-08-06 07:52:18

问题


I updated my Angular to version 8, and I have run into a small problem. when I start the app with ionic serve

 Error: Can't resolve all parameters for setupPlatform: (?, [object 
 Object], [object Object]).
    at syntaxError (http://localhost:8100/build/vendor.js:177346:17)
    at CompileMetadataResolver._getDependenciesMetadata 
 (http://localhost:8100/build/vendor.js:196072:35)
    at CompileMetadataResolver._getFactoryMetadata 
 (http://localhost:8100/build/vendor.js:195972:51)
   at CompileMetadataResolver.getProviderMetadata 
 (http://localhost:8100/build/vendor.js:196204:43)
  at http://localhost:8100/build/vendor.js:196134:49
  at Array.forEach (<anonymous>)
  at CompileMetadataResolver._getProvidersMetadata 
 (http://localhost:8100/build/vendor.js:196094:19)
  at http://localhost:8100/build/vendor.js:195717:119
  at Array.forEach (<anonymous>)
  at CompileMetadataResolver.getNgModuleMetadata 
(http://localhost:8100/build/vendor.js:195708:49)

I have tried to rollback to an older version, still get the same problem. I have another ionic app and it works with the config I have.

The config are:

Ionic:

  Ionic CLI          : 5.2.1
  Ionic Framework    : ionic-angular 3.9.6
  @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 6.5.0
   Cordova Platforms : android 6.1.2, browser 4.1.0, ios 4.5.5
   Cordova Plugins   : cordova-plugin-ionic-webview 1.2.1, (and 16 other plugins)

Utility:

    cordova-res : 0.5.1 
    native-run  : 0.2.7 

System:

  NodeJS : v10.15.1 (/usr/local/bin/node)
  npm    : 6.9.0
  OS     : macOS Mojave

 Angular CLI: 7.3.0
 Node: 10.15.1
 OS: darwin x64
 Angular: 8.0.3
 ... animations, common, compiler, compiler-cli, core, forms
 ... platform-browser, platform-browser-dynamic

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.0 (cli-only)
@angular-devkit/build-optimizer   0.0.35
@angular-devkit/core              7.3.0 (cli-only)
@angular-devkit/schematics        7.3.0 (cli-only)
@angular/fire                     5.2.1
@angular/http                     7.2.15
@schematics/angular               7.3.0 (cli-only)
@schematics/update                0.13.0 (cli-only)
rxjs                              6.5.2
typescript                        3.5.2
webpack                           3.12.0

I have no idea what setupPlatform, it's not in the code i written. I assume is part of some add on plugin, I did a search using VS Code - did not get a match on setupPlatform. I'm a bit stuck and in my searches to find a solution, I have not found anyone had a similar issue. Need some help on this one.

Thanks.


回答1:


I was receiving the same error message. I used Inspect with Chrome Developer Tools to track it to a hasunknowdependency = true error on "PLTCONFIG" as it runs through the NgModules. The missing parameter is the "doc" parameter of setupPlatform(). I then tracked that to the "DOCUMENT" no longer exported from platform-browser issue referenced here: "export 'DOCUMENT' was not found in '@angular/platform-browser'. After I made the changes the error disappeared. I hope this helps.



来源:https://stackoverflow.com/questions/56858934/error-cant-resolve-all-parameters-for-setupplatform-object-object-obj

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!