"ng build --prod" Error when destructuring an array from namespace
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
I have this namespace
export namespace Anamespace {
export const Components = [
AComponent1,
AComponent2
];
}
in another file a declared a module that uses the namespace above
@NgModule({
declarations: [...Anamespace.Components],
exports: [...Anamespace.Components]
})
export classe Amodule{}
when running “ng serve” everything works fine. But when running “ng build --prod” i get this error:
ERROR in Error during template compile of ‘Amodule’ Unsupported import syntax.
Environment
Angular version: ^5.2.11
Browser:
- [ x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: 6.11.3
- Platform: Linux
Others:
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Javascript array destructuring assignment gives strange errors
It appears that the array destructuring assignment is being parsed as an array indexing operation applied to the previous statement.
Read more >Overzealous Destructuring | Aleksandr Hovhannisyan
The first problem with destructuring is that it strips object properties of their namespace, making it harder to tell, at a glance, ...
Read more >destructuring array es6 Code Example - Code Grepper
ng has unexpectedly closed (exit code 127). ... If 'router-outlet' is an Angular component, then verify that it is part of this module....
Read more >Google TypeScript Style Guide
Tip: If you only need some of the elements from an array (or TypeScript tuple), you can insert extra commas in a destructuring...
Read more >typeerror: cannot read properties of undefined jasmine - You.com ...
npm/logs/2018-10-16T054330433Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! awesome-seo@0.0.0 build:prod: npm run build:server:prod && npm run ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mcherb It looks like this is fixed with Ivy. Afaik Ivy isn’t released yet. So this would mean it’s not fixed in Angular 7 . You could try enabling Ivy and see how it works out for you, but I don’t think that’s recommended for production yet.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.