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.

ES2015 problem since Angular 8

See original GitHub issue

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

I have upgraded my apps to Angular 8, but if I use es2015 as target in tsconfig.json and use a browser with es2015 support, then the lib is not working correctly (see How to reproduce).

How To Reproduce

Take a look at my repo: https://github.com/paulstelzer/ngxs-issue

There are two branches: master and language. The difference between the two: Inside language branch, the source code is directly in the app. In master I am using the lib created with ng-packagr.

If you now build the repo with production (ng build --prod) a ES5 and ES2015 files will be created (the default since Angular 8).

If you now run the master branch (which is using the lib created with ng-packagr) and ES2015 the lib isn’t working anymore. You can see it because the log “LANGUAGE checkLanguage” will not be shown in console. If you remove the es2015 part from index.html, the app is working again.

If you use the language branch (without a lib built with ng-packagr), ES2015 is working.

If you only build ES5, also the master branch with the lib built with ng-packagr will work.

For me it seems that ng-packagr made somehting that it’s not working in ES2015

Expected Behaviour

Lib should work with ES2015 builded application

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr:            5.2.0
@angular/compiler:     8.0.0
rollup:                1.12.5
tsickle:               0.35.0
typescript:            3.4.5
node: 10.12.0
npm: 6.9.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
alan-agius4commented, Jun 5, 2019
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

Angular 8 main-es2015 does not load the entire code over ...
I'm having a problem with main-es2015 javascript file generated by ng build --prod on Angular 8. When I try to open the website...
Read more >
Angular 8 + grid is broken for es2015 bundles using the ...
Hi, more problems with Grid and Angular 8. In latest version (17.1.50), after upgrade project to Angular 8, pager is broken (image attached)....
Read more >
Guide to update your Angular application v8.2 -> v12.0 for ...
Run NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/core@8 @angular/cli@8 in your workspace directory to update to the latest 8.x version of @ ...
Read more >
A hard lesson of upgrading to Angular 8 - iFiona
Since Angular 8, the TypeScript compiler is targeting at a newer ECMAScript version es2015 by default. Hence, when you upgarde Angular, ...
Read more >
After upgrading to Angular 8 getting errors loading data using ...
It turns out that as part of the Angular upgrade, typescript is updated to 3.5.3 and the CLI has been changed to build...
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