Title: Ivy compiler doesn't work with secondary entry points in libraries using dist folder · Issue #35188 · angular/angular · GitHub
Open Graph Title: Ivy compiler doesn't work with secondary entry points in libraries using dist folder · Issue #35188 · angular/angular
X Title: Ivy compiler doesn't work with secondary entry points in libraries using dist folder · Issue #35188 · angular/angular
Description: 🐞 bug report Affected Package @angular/compiler@9.0.0 (ngcc) Is this a regression? Not known Description We have a monorepo managed with the Angular CLI with several libraries, each with secondary entry points, and a showcase. We build t...
Open Graph Description: 🐞 bug report Affected Package @angular/compiler@9.0.0 (ngcc) Is this a regression? Not known Description We have a monorepo managed with the Angular CLI with several libraries, each with secondary ...
X Description: 🐞 bug report Affected Package @angular/compiler@9.0.0 (ngcc) Is this a regression? Not known Description We have a monorepo managed with the Angular CLI with several libraries, each with secondary ...
Opengraph URL: https://github.com/angular/angular/issues/35188
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ivy compiler doesn't work with secondary entry points in libraries using dist folder","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n@angular/compiler@9.0.0 (ngcc)\r\n\r\n\r\n### Is this a regression?\r\nNot known\r\n\r\n\r\n### Description\r\nWe have a monorepo managed with the Angular CLI with several libraries, each with secondary entry points, and a showcase. We build the libraries using the ViewEngine compiler and the showcase with Ivy. Once we build the showcase, Ivy seems to fail to compile imported symbols in secondary entry points, which results in the error code NG6002 (See error below).\r\n\r\nWe used the following guide for secondary entry points: https://github.com/ng-packagr/ng-packagr/blob/v9.0.0/docs/secondary-entrypoints.md\r\nThe built library artifacts reside in the dist folder (default Angular CLI configuration)\r\n\r\nStrangely enough, when we copy the build artifacts into node_modules and remove the `compilerOptions.paths` entry in tsconfig.json, ngcc seems to compile it successfully.\r\nIf we leave it in dist, ngcc seems to stop compiling secondary entrypoints after the first/entry file.\r\n\r\n## 🔬 Minimal Reproduction\r\n1. clone https://github.com/jeripeierSBB/lib-with-secondary-entry-points\r\n2. `ng build my-lib --prod`\r\n3. `ng build showcase --prod` (or `ng serve`)\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\nERROR in dist/my-lib/my-feature/my-feature.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class\r\n\r\n1 export declare class MyFeatureModule {\r\n\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 9.0.0\r\nNode: 13.7.0\r\nOS: darwin x64\r\n\r\nAngular: 9.0.0\r\n... animations, cli, 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.0\r\n@angular-devkit/build-angular 0.900.0\r\n@angular-devkit/build-ng-packagr 0.900.0\r\n@angular-devkit/build-optimizer 0.900.0\r\n@angular-devkit/build-webpack 0.900.0\r\n@angular-devkit/core 9.0.0\r\n@angular-devkit/schematics 9.0.0\r\n@ngtools/webpack 9.0.0\r\n@schematics/angular 9.0.0\r\n@schematics/update 0.900.0\r\nng-packagr 9.0.0\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\n\r\n## Workaround\r\n1. `ng build my-lib --prod`\r\n2. copy content of dist folder to node_modules\r\n3. remove `compilerOptions.paths` in tsconfig.json\r\n4. `ng build showcase --prod` (or `ng serve`)\r\n5. compiles successfully","author":{"url":"https://github.com/jeripeierSBB","@type":"Person","name":"jeripeierSBB"},"datePublished":"2020-02-06T13:39:50Z","url":"https://github.com/angular/angular/issues/35188"}
| 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:6692884f-3d60-07ec-5623-57390445e478 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB1C:928E2:105572C:15D2AFC:6B01143D |
| html-safe-nonce | 88c2a43458a3c9d9eda57ae2a1b5e48d6ee32aebc634b5a8b31b5acf3a0c64ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjFDOjkyOEUyOjEwNTU3MkM6MTVEMkFGQzo2QjAxMTQzRCIsInZpc2l0b3JfaWQiOiI0OTA4NDk1NTMyMzk1Nzc2NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e38a52b7cfa3019c43206e194a237cc854864c1adb1efc0da34734efd17b9dac |
| hovercard-subject-tag | issue:561019232 |
| 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/35188/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3bf5cac561f6618a119eabcfc4a97b990e2324f600022157f40d3698fcd2b68e/angular/angular/issues/35188 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3bf5cac561f6618a119eabcfc4a97b990e2324f600022157f40d3698fcd2b68e/angular/angular/issues/35188 |
| og:image:alt | 🐞 bug report Affected Package @angular/compiler@9.0.0 (ngcc) Is this a regression? Not known Description We have a monorepo managed with the Angular CLI with several libraries, each with secondary ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeripeierSBB |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width