[英]Can't resolve all parameters for NgxGalleryPreviewComponent after ng serve
I recently updated my angular project from version 8 to 9 and have been experiencing the above mentioned issue.我最近将我的 angular 项目从版本 8 更新到了 9,并且遇到了上述问题。 My project makes use of ngx-gallery
and after the update to angular 9, I updated all references to the deprecated Renderer
service to Renderer2
inside ngx-gallery-helper.service.d.ts
and ngx-gallery-preview.component.d.ts
.我的项目使用了ngx-gallery
,在更新到 angular 9 之后,我将所有对已弃用的Renderer
服务的引用更新到ngx-gallery-helper.service.d.ts
和ngx-gallery-preview.component.d.ts
Renderer2
ngx-gallery-preview.component.d.ts
。
My currently installed version of npx-gallery
is the latest one (5.10.0).我当前安装的 npx npx-gallery
版本是最新版本 (5.10.0)。 When I run ng serve
the home page doesn't even load, I get the following error in the console:当我运行ng serve
,主页甚至没有加载,我在控制台中收到以下错误:
Uncaught Error: Can't resolve all parameters for NgxGalleryPreviewComponent: ([object Object], [object Object], [object Object], ?, [object Object]).
at syntaxError (compiler.js:2281)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:21063)
at CompileMetadataResolver._getTypeMetadata (compiler.js:20958)
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (compiler.js:20573)
at CompileMetadataResolver.loadDirectiveMetadata (compiler.js:20437)
at compiler.js:26467
at Array.forEach (<anonymous>)
at compiler.js:26466
at Array.forEach (<anonymous>)
at JitCompiler._loadModules (compiler.js:26463)
Running ng --version
inside my project root folder outputs the following:在我的项目根文件夹中运行ng --version
输出以下内容:
Angular CLI: 9.0.1
Node: 12.8.0
Angular: 9.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.900.1
@angular-devkit/build-angular 0.900.1
@angular-devkit/build-optimizer 0.900.1
@angular-devkit/build-webpack 0.900.1
@angular-devkit/core 9.0.1
@angular-devkit/schematics 9.0.1
@angular/cli 9.0.1
@angular/flex-layout 9.0.0-beta.29
@angular/material-moment-adapter 8.2.3
@ngtools/webpack 9.0.1
@schematics/angular 9.0.1
@schematics/update 0.900.1
rxjs 6.5.4
typescript 3.7.5
webpack 4.41.2
What am I missing?我错过了什么? Your help would be greatly appreciated.您的帮助将不胜感激。 Thank you.谢谢你。
Files "ngx-gallery-helper.service.d.ts" and "ngx-gallery-preview.component.d.ts" are inside folder node_modules.文件“ngx-gallery-helper.service.d.ts”和“ngx-gallery-preview.component.d.ts”位于文件夹 node_modules 中。 Node_modules generated automatically with npm.使用 npm 自动生成的 Node_modules。 No changes inside folder 'node_modules' possible.文件夹“node_modules”内不可能发生任何变化。 It will be recreated with npm.它将使用 npm 重新创建。
Solution of bug must be not very hard.解决bug应该不是很难。 As usual.照常。 Change "Renderer" -> "Renderer2" and related items.更改“渲染器”->“渲染器2”和相关项目。 But really big problem - this gallery in repository and only author of ngx-gallery has got access.但真正的大问题 - 存储库中的这个画廊并且只有 ngx-gallery 的作者可以访问。
What can be done:可以做什么:
BTW https://github.com/thatisuday/ngx-image-gallery works well with Angular 9. Just checked.顺便说一句, https://github.com/thatisuday/ngx-image-gallery与 Angular 9 配合良好。刚刚检查过。 And good customisation.和良好的定制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.