René's URL Explorer Experiment


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-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:725cddaf-f483-d7c9-2a5e-1efb589dbe2f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA3C6:62283:ABDD56:E58FD7:6B00EC14
html-safe-nonce77ab0fdfffe1bf2c0863f6979d34aaeeaebb129f5d8dc596238f044f8693ca6c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0M2OjYyMjgzOkFCREQ1NjpFNThGRDc6NkIwMEVDMTQiLCJ2aXNpdG9yX2lkIjoiMjUzMTc4ODYzMDQyNzQ5NTQ0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacba260fdcae3f4d45fa9bb7acbffd38bc5045dbbe2745a9e945d5b56abc1c1580
hovercard-subject-tagissue:275860985
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/8581/issue_layout
twitter:imagehttps://opengraph.githubassets.com/07a5e8bc9ef54caa28f9d169bb5ae7d13a593eb1fdf010cafa9698629f0d4378/angular/angular-cli/issues/8581
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/07a5e8bc9ef54caa28f9d169bb5ae7d13a593eb1fdf010cafa9698629f0d4378/angular/angular-cli/issues/8581
og:image:altI'm submitting a... [x] Bug report [ ] Feature request Versions