Title: IVY Error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class · Issue #35399 · angular/angular · GitHub
Open Graph Title: IVY Error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class · Issue #35399 · angular/angular
X Title: IVY Error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class · Issue #35399 · angular/angular
Description: 🐞 bug report Affected Package The issue might be related to package ng-packagr Is this a regression? Yes, the previous version in which this bug was not present was: 8.2.14 Description Possible duplicate of #35331, #34983, #35255, and #3...
Open Graph Description: 🐞 bug report Affected Package The issue might be related to package ng-packagr Is this a regression? Yes, the previous version in which this bug was not present was: 8.2.14 Description Possible dup...
X Description: 🐞 bug report Affected Package The issue might be related to package ng-packagr Is this a regression? Yes, the previous version in which this bug was not present was: 8.2.14 Description Possible dup...
Opengraph URL: https://github.com/angular/angular/issues/35399
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"IVY Error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->\r\n\u003c!-- ✍️edit: --> The issue might be related to package \r\n[ng-packagr](https://github.com/ng-packagr/ng-packagr)\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\n\u003c!-- ✍️--> Yes, the previous version in which this bug was not present was: 8.2.14\r\n\r\n\r\n### Description\r\nPossible duplicate of #35331, #34983, #35255, and #30972, but I'm including a minimal reproduction repo. Building with IVY throws the following error (see the Exception or Error section)\r\n\r\n\r\n\r\nOur real app, which uses a shared module, throws a slightly different error:\r\n\r\n\r\n\r\nRunning the ng-packagr postinstall script adds \"__ivy_ngcc__\" folders to some of our other dependencies, but does not touch the [angular2-highcharts](https://github.com/gevgeny/angular2-highcharts) library. The library does not use the Angular Package Format, which might be part of the problem, but I'm not the library's author and have never built an ES6/angular library myself, so I'm just guessing at a potential fix.\r\n\r\nUnfortunately, the library is no longer maintained, but it is one of our app's core/major dependencies. I also attempted to rebuild the library from the source files after adding the following to the library's package.json file:\r\n\r\n\u003cpre>\u003ccode>\r\n\"postinstall\": \"ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points\",\r\n\"ngPackage\": {\r\n \"lib\": {\r\n \"entryFile\": \"index.d.ts\"\r\n }\r\n},\r\n\u003c/pre>\u003c/code>\r\n\r\nBut this produces the following error:\r\n\r\n\r\n\r\nThere is no \"files\" array provided in the library's package.json file, so I'm not sure what the error is referring to. I fixed all Angular 9-related issues prior to re-building the library, so I assume it has to do with the way it's packaged or how it exports the modules/components.\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\nStackBlitz\r\nhttps://angular-ivy-cant-be-resolved.stackblitz.io\r\n\r\nGitHub repo in case StackBlitz isn't working:\r\nhttps://github.com/stevethemacguy/angular-ivy-cant-be-resolved-bug\r\n\r\nSteps to Reproduce\r\n1. Download or clone the repo\r\n2. npm install\r\n3. ng build (or ng serve)\r\n\r\nExpected behavior: IVY builds the app\r\nActual behavior: IVY displays an error.\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>ERROR in node_modules/angular2-highcharts/dist/index.d.ts:8:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class\r\n\r\n8 export declare class ChartModule {\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍 Your Environment\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>Angular CLI: 9.0.2\r\nNode: 10.15.3\r\nOS: darwin x64\r\n\r\nAngular: 9.0.1\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.900.2\r\n@angular-devkit/build-angular 0.900.2\r\n@angular-devkit/build-optimizer 0.900.2\r\n@angular-devkit/build-webpack 0.900.2\r\n@angular-devkit/core 9.0.2\r\n@angular-devkit/schematics 9.0.2\r\n@angular/cli 9.0.2\r\n@ngtools/webpack 9.0.2\r\n@schematics/angular 9.0.2\r\n@schematics/update 0.900.2\r\nrxjs 6.5.4\r\ntypescript 3.7.5\r\nwebpack 4.41.2\r\n\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\nAfter disabling IVY, our real app successfully builds in AOT (prod mode) using Angular 9.0.1, so the issue seems to be an Angular regression that is un-related to our app (except for the [angular2-highcharts](https://github.com/gevgeny/angular2-highcharts) dependency). Our app uses a custom angular/webpack build. It does not use Angular CLI.","author":{"url":"https://github.com/stevethemacguy","@type":"Person","name":"stevethemacguy"},"datePublished":"2020-02-13T02:41:54Z","url":"https://github.com/angular/angular/issues/35399"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e5359ff6-a1a5-2179-f0bc-17b4926574db |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B7A6:38C5CF:1216D65:17239ED:6B010859 |
| html-safe-nonce | 7879de1ef8326cd3c5719b186f0e840c827cf73127e0258edd41fdf539499681 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0E2OjM4QzVDRjoxMjE2RDY1OjE3MjM5RUQ6NkIwMTA4NTkiLCJ2aXNpdG9yX2lkIjoiMTU1MTM1MjE4MzQ5OTMyNzU3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8060659360499d7ad8b265480bc6a823b723ee745505dbcb35b6485eae2b193d |
| hovercard-subject-tag | issue:564402588 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/35399/issue_layout |
| twitter:image | https://opengraph.githubassets.com/269b01013326adffb849cf5f6b8b3e42f798450579b422c799726800f92b0dce/angular/angular/issues/35399 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/269b01013326adffb849cf5f6b8b3e42f798450579b422c799726800f92b0dce/angular/angular/issues/35399 |
| og:image:alt | 🐞 bug report Affected Package The issue might be related to package ng-packagr Is this a regression? Yes, the previous version in which this bug was not present was: 8.2.14 Description Possible dup... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stevethemacguy |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width