'PlotlyModule' does not appear to be an NgModule class.

未关闭
#255 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
angular, typescript
领域
frontend

调研方向

首先,使用 issue 中列出的 Angular 17 和 angular-plotly.js 4.0.4 版本重现 NG6002 错误。检查 app.module.ts 和 node_modules/angular-plotly.js/lib/plotly.module.d.ts,然后验证无需 Ivy 兼容性错误即可导入 PlotlyModule。

由索引模型根据 Issue 内容生成。

描述

We are experiencing an issue when using angular-plotly.js and Angular17 saying that "'PlotlyModule' does not appear to be an NgModule class."

Error

error NG6002: 'PlotlyModule' does not appear to be an NgModule class.

176     PlotlyModule,
        ~~~~~~~~~~~~

  node_modules/angular-plotly.js/lib/plotly.module.d.ts:1:22
    1 export declare class PlotlyModule {
                           ~~~~~~~~~~~~
    This likely means that the library (angular-plotly.js) which declares PlotlyModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

app.module.ts

import * as PlotlyJS from 'plotly.js-dist-min';
import { PlotlyModule } from 'angular-plotly.js';
PlotlyModule.plotlyjs = PlotlyJS;

@NgModule({
  declarations: [
    ...,
  ],
  imports: [
    ...,
    PlotlyModule,
    ...,
]
});

Package Details

"@angular/animations": "^17.0.9",
 "@angular/cdk": "^16.2.13",
 "@angular/common": "^17.0.9",
 "@angular/compiler": "^17.0.9",
 "@angular/core": "^17.0.9",
 "@angular/forms": "^17.0.9",
 "@angular/material": "^16.2.13",
 "@angular/platform-browser": "^17.0.9",
 @angular/platform-browser-dynamic": "^17.0.9",
 "@angular/router": "^17.0.9",
 "angular-plotly.js": "^4.0.4",
 "moment": "^2.29.4",
 "plotly.js-dist-min": "^2.21.0",
 "rxjs": "~7.5.0",
 "tslib": "^2.3.0",
 "zone.js": "~0.14.3"

Is there something that can be done that will enable this to work?

主要语言
TypeScript
星标
242
派生
81
平均合并
8 小时 48 分钟
30 天内合并 PR
18

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

plotly/angular-plotly.js 的其他 Issue

查看 plotly/angular-plotly.js 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。