Title: @ngtools/webpack AOT loader failed to resolve nested exports (Barrels) · Issue #8581 · angular/angular-cli · GitHub
Open Graph Title: @ngtools/webpack AOT loader failed to resolve nested exports (Barrels) · Issue #8581 · angular/angular-cli
X Title: @ngtools/webpack AOT loader failed to resolve nested exports (Barrels) · Issue #8581 · angular/angular-cli
Description: I'm submitting a... [x] Bug report [ ] Feature request Versions \r\n\u003cpre>\u003ccode>\r\n[x] Bug report \r\n[ ] Feature request\r\n\u003c/code>\u003c/pre>\r\n\r\n### Versions\r\n```\r\n\u003c!--\r\nOutput from: `ng --version`.\r\nIf nothing, output from: `node --version` and `npm --version`.\r\n Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)\r\n-->\r\n@ngtools/webpack: 1.8.3\r\nnode: 6.11.1\r\nnpm: 5.5.1\r\nos: win10 x64\r\nangular: 5.0.2\r\ntypescript: 2.5.3\r\n```\r\n\r\n### Repro steps\r\n\u003c!--\r\nSimple steps to reproduce this bug.\r\nPlease include: commands run, packages added, related code changes.\r\nA link to a sample repo would help too.\r\n-->\r\nUse barrels system in project based on index.ts, that every feature folder consists of index.ts where you can re-export components, so instead of:\r\n`import { AuthService } from '@app/core/services/auth.service';`\r\nYou can do: \r\n`import * as Core from '@app/core';`\r\nand use any entity inside Core like this:\r\n`Core.Services.AuthService`\r\n\r\nReproduction:\r\n\r\n- [Repo based on JIT:at-loader and AOT:ngtools](https://github.com/Sky4CE/angular-5-aot-lazy-barrels), JIT works, AOT does not\r\n- [Repo based on angular-cli both JIT and AOT](https://github.com/Sky4CE/angular-5-cli-barrels), neither works\r\n\r\n\r\n### Observed behavior\r\n\r\nJIT compiles like a charm without any problems, but when I try to compile using AOT with help of `@ngtools/webpack` mentioned behavior not work. AOT plugin cannot see any further than second property, for example when I inject service into constructor like this:\r\n`constructor(private router: Router, private authService: Core.Services.AuthService)`\r\nI get next error:\r\n`ERROR in Error: Can't resolve all parameters for AppLaunchComponent in /Client/app/app.launch.ts: ([object Object], ?).`\r\nso second parameter does not recognized, but when I import CoreServices directly and use like this:\r\n`constructor(private router: Router, private authService: CoreServices.AuthService)`\r\nit could recognize all parameters.\r\nBut I really like to import one-line just Core and nothing more, because we have 1000+ components in our app, so import each separately is absolutely not an option.\r\n\u003c!-- Normally this includes a stack trace and some more information. -->\r\n\r\n\r\n### Desired behavior\r\nDo not drop(tree-shake) nested exports while parsing import sequence!\r\n\r\nIs it possible to see this bug fixed ?\r\n\r\n","author":{"url":"https://github.com/Sky4CE","@type":"Person","name":"Sky4CE"},"datePublished":"2017-11-21T21:11:27Z","url":"https://github.com/angular/angular-cli/issues/8581"}
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:725cddaf-f483-d7c9-2a5e-1efb589dbe2f current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id A3C6:62283:ABDD56:E58FD7:6B00EC14 html-safe-nonce 77ab0fdfffe1bf2c0863f6979d34aaeeaebb129f5d8dc596238f044f8693ca6c visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0M2OjYyMjgzOkFCREQ1NjpFNThGRDc6NkIwMEVDMTQiLCJ2aXNpdG9yX2lkIjoiMjUzMTc4ODYzMDQyNzQ5NTQ0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 visitor-hmac ba260fdcae3f4d45fa9bb7acbffd38bc5045dbbe2745a9e945d5b56abc1c1580 hovercard-subject-tag issue:275860985 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-cli/8581/issue_layout twitter:image https://opengraph.githubassets.com/07a5e8bc9ef54caa28f9d169bb5ae7d13a593eb1fdf010cafa9698629f0d4378/angular/angular-cli/issues/8581 twitter:card summary_large_image og:image https://opengraph.githubassets.com/07a5e8bc9ef54caa28f9d169bb5ae7d13a593eb1fdf010cafa9698629f0d4378/angular/angular-cli/issues/8581 og:image:alt I'm submitting a... [x] Bug report [ ] Feature request Versions