Skip to content

Failed to fetch dynamically imported module for one route with ESBuild #26572

@Akxe

Description

@Akxe

Command

serve

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

Out of all the routes in my app, only one is not accessible. The module that is not able to be downloaded is our-carriers.module-PNSZ4EEZ.js. For some reason, it is always this module and at the end of its size is m. I did not add the letter m myself; it is always there and only there. The file our-carriers.module-PNSZ4EEZ.js is not generated, the file is generated under the name chunk-PWPQDDBC.js. In prod mode, the chunk is generated with an aligned name and filename of chunk-PWPQDDBC.

This is the output from ng serve

Initial Chunk Files                | Names                  |  Raw Size
chunk-SDNCR5MF.js                  | -                      |   1.18 MB | 
polyfills.js                       | polyfills              | 432.84 kB | 
chunk-AUKJNR2G.js                  | -                      | 246.74 kB | 
styles.css                         | styles                 | 199.52 kB | 
main.js                            | main                   | 133.36 kB | 
chunk-WHPMNZNR.js                  | -                      |   4.70 kB | 
chunk-7TMU4YQV.js                  | -                      |   4.49 kB | 
chunk-ANO7H7MC.js                  | -                      |   4.23 kB | 
chunk-VKMYJVAG.js                  | -                      |   4.19 kB | 
chunk-UTWFV6PQ.js                  | -                      |   3.13 kB | 
chunk-IOITSHYQ.js                  | -                      |   2.30 kB | 
chunk-JI4S4GJY.js                  | -                      | 941 bytes | 

                                   | Initial Total          |   2.19 MB

Lazy Chunk Files                   | Names                  |  Raw Size
permits.module-5CYUNLWT.js         | permits-module         | 306.06 kB | 
show-in-map.module-6XG6JXZS.js     | show-in-map-module     | 189.50 kB | 
inquiry.module-PPNSWAYP.js         | inquiry-module         | 142.72 kB | 
create-invoice.module-D6MRIEBQ.js  | create-invoice-module  |  95.10 kB | 
process-mapper.module-CS4SFB2C.js  | process-mapper-module  |  81.99 kB | 
task.module-LKZMQ5A2.js            | task-module            |  45.96 kB | 
chunk-J7PY3V6B.js                  | -                      |  32.65 kB | 
mapper.module-PY2OPC4W.js          | mapper-module          |  25.47 kB | 
invoicing.module-U7PC2253.js       | invoicing-module       |  21.73 kB | 
profile.module-JS6YN7QO.js         | profile-module         |  20.04 kB | 
chunk-BSRT6VUQ.js                  | -                      |  19.70 kB | 
offerings.module-P7DMCCJE.js       | offerings-module       |  16.36 kB | 
admin.module-U5IK6H4X.js           | admin-module           |  16.36 kB | 
offering.module-NSFIV3U4.js        | offering-module        |  13.61 kB | 
chunk-MF3Q5ELX.js                  | -                      |  13.52 kB | 
map.module-4AU2BX2G.js             | map-module             |  12.48 kB | 
chunk-C6A6IGMR.js                  | -                      |  10.83 kB | 
our-carriers.module-PNSZ4EEZ.js    | our-carriers-module    |   5.57 kBm | 
settings.module-6AT4YESA.js        | settings-module        |   5.48 kB | 
show-folder-gps.module-OEATXTTT.js | show-folder-gps-module |   5.25 kB | 
chunk-IZARFIZU.js                  | -                      |   4.57 kB | 
chunk-T76RBWOY.js                  | -                      |   2.39 kB | 
chunk-6EDY57G5.js                  | -                      |   2.29 kB | 
issues.module-L4VVJ4PY.js          | issues-module          |   2.04 kB | 
chunk-Y2WNJNYG.js                  | -                      |   1.39 kB | 

Minimal Reproduction

This error is not reproduced in smaller project. I do not know how to produce minimal reproduction error.

Exception or Error

app-routing.module.ts:64
GET http://localhost:4200/our-carriers.module-PNSZ4EEZ.js net::ERR_ABORTED 404 (Not Found)
app-routing.module.ts:64 TypeError: Failed to fetch dynamically imported module: http://localhost:4200/our-carriers.module-PNSZ4EEZ.js


### Your Environment

```text
Angular CLI: 17.0.3
Node: 21.2.0 (Unsupported)
Package Manager: npm 9.6.6
OS: win32 x64

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

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1700.3
@angular-devkit/core         17.0.3
@angular-devkit/schematics   17.0.3
@angular/cdk                 17.0.1
@angular/cdk-experimental    17.0.1
@angular/cli                 17.0.3
@angular/google-maps         17.0.1
@angular/material            17.0.1
@schematics/angular          17.0.3
rxjs                         7.8.1
typescript                   5.2.2
zone.js                      0.14.2

Anything else relevant?

I am using nx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions