angular-cli: Promise generated by writeBuffer() from exceljs is broken in production

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 7.x

Description

In my project, I use the exceljs library for some light spreadsheet manipulation. However, with Angular 8, there’s something going wrong with the build. On the dev server, calls to writeBuffer()'s promise complete as expected. But once the production build is created, it’s like the promise writeBuffer() creates is never run.

πŸ”¬ Minimal Reproduction

Here is a stackblitz which captures the basics of the problem; however, note that for the stackblitz, writeBuffer() works (I believe it’s running in development mode). https://stackblitz.com/edit/angular-xi5bzs

This library has been working since Angular 4, but maybe I importing it incorrectly.

This is how I make the library available to my app. In tsconfig.json:

tsconfig.json


{
  "compileOnSave": false,
  "compilerOptions": {
    "paths": {
      "exceljs": ["node_modules/exceljs/dist/exceljs.min"],
    },
  ...

🌍 Your Environment




Angular CLI: 8.0.1
Node: 10.15.3
OS: linux x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.1
@angular-devkit/build-angular     0.800.1
@angular-devkit/build-optimizer   0.800.1
@angular-devkit/build-webpack     0.800.1
@angular-devkit/core              8.0.1
@angular-devkit/schematics        8.0.1
@angular/cli                      8.0.1
@ngtools/webpack                  8.0.1
@schematics/angular               8.0.1
@schematics/update                0.800.1
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0

Anything else relevant?

Happens for both ES5 and ES6 targets, Chrome and IE11 (no other browsers tested).

About this issue

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

Most upvoted comments

Problem is with ExcelJs, same code with 1.10.0 works but not with 1.12.2.

Hi all, exceljs 1.10.0 works for me with angular 7.2.2. I was facing the same issue with exceljs 1.12 and 1.13 in angular 7.2.2, I downgrade the exceljs version to 1.10.0 and it works for me in angular 7.2.