question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhanced object literals ES6 support

See original GitHub issue

Type of Issue

[ ] Bug Report
[ ] Feature Request
[X] Not sure

Description

There is an error during ng-packagr running script:

Dropping unreachable code [0:371,8]
Declarations in unreachable code! [0:371,8]

I found out, method which returns object with enhanced object literals cuase an error above:

  private _exampleMethod(): any {
    return {
        [`${TestComponent.prefix}disabled`]: this.disabled,
        [`${TestComponent.prefix}${this.type}`]: this.type,
    };
  }

Expected Behaviour

No error

Dropping unreachable code [0:371,8]
Declarations in unreachable code! [0:371,8]

Version Information

ng-packagr:            2.4.2
@angular/compiler:     5.2.10
@angular/compiler-cli: 5.2.10
rollup:                0.55.5
tsickle:               0.27.5
typescript:            2.5.3
rxjs: 5.5.10
node: 8.11.1
npm 6.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alan-agius4commented, Jun 13, 2018

Not really, I guess what’s best is to open an issue with them. And explain the problem. By grabbing the outputted unminified UMD bundle and try to uglify it.

If you need any further help to report the problem. Let me know.

I’d appreciate if you tag me when you open it 😃

On Wed, 13 Jun 2018 at 14:13, beatadelura notifications@github.com wrote:

@alan-agius4 https://github.com/alan-agius4 Do you have any knowledge from uglify-js for support similar issues?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dherges/ng-packagr/issues/939#issuecomment-396915968, or mute the thread https://github.com/notifications/unsubscribe-auth/AQv-WniRUKoStlbdZvW15n5yxnmWKaObks5t8QH3gaJpZM4UirwD .

0reactions
github-actions[bot]commented, Jun 19, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES6 in Action: Enhanced Object Literals - SitePoint
The ability to create JavaScript objects using literal notation is powerful. New features introduced from ES2015 (ES6) make object handling ...
Read more >
Enhanced Object Properties | Advanced JavaScript
In summary, ES6 added three ways to simplify the declaration of object literals, that is, property notation, function notation, and computed properties. To ......
Read more >
JavaScript(ES6) | Object Literal Enhancement - GeeksforGeeks
Object literal enhancement is used to group variables from the global scope and form them into javascript objects.
Read more >
Enhanced Object Literals - Rediscovering JavaScript
The object literals syntax makes it possible to assign values to fields and create functions within an object. It is the colon notation...
Read more >
Enhanced Object Literal Value Shorthand: JavaScript ES6 ...
Starting with ECMAScript 2015, the object initializer syntax supports computed property names. This feature allows you to put an expression in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found