Skip to content

"Invalid string length" building a library #25998

@VincenzoManto

Description

@VincenzoManto

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Running ng build <project>, we obtain

❌  Generating "fesm2015"

Invalid string length

Indeed, fesm2020 build succeeded.

The dist sourcemap for fesm2020 reached 32MB, while the fesm2015 sourcemap reached 33MB (.mjs.map file).

The entire source code is about 200 components distributed in 1 single library.

Minimal Reproduction

  • Create 200+ components and include them in a single library module
  • run ng build <project>

Exception or Error

Invalid string length after Generating fesm2015

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 14.2.6
Node: 18.15.0 (Unsupported)
Package Manager: npm 9.5.0
OS: win32 x64

Angular: 14.2.6
... animations, cli, common, compiler, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.6
@angular-devkit/build-angular   14.2.6
@angular-devkit/core            14.2.6
@angular-devkit/schematics      14.2.6
@angular/compiler-cli           14.3.0
@schematics/angular             14.2.6
ng-packagr                      14.0.1
rxjs                            6.5.4
typescript                      4.7.3

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions