Skip to content

HMR in NG 11 issue: Cannot use [chunkhash] or [contenthash] for chunk in '[name].[chunkhash:20].js' (use [hash] instead) #19394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LanderBeeuwsaert opened this issue Nov 15, 2020 · 3 comments

Comments

@LanderBeeuwsaert
Copy link

🐞 Bug report

Command (mark with an x)

  • [ x] serve

Is this a regression?

Not Really, HMR working OOTB is something new to angular 11

Description

So as per the angular 11 release blogpost, HMR should work if enabled with ng serve --configuration some_configuration --hmr
However if I do that I get an error (which I don't get if I leave out the --hmr)

🔥 Exception or Error

command in package.json:
"t": "ng serve --configuration env-t --hmr",

in angular.json:
"serve": {
"configurations": {
"env-t": {
"browserTarget": "acro-companion:build:env-t-as-dev"
},

And:
"architect": {
"build": {
"configurations": {
"env-t-as-dev": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"namedChunks": false,
"aot": false,
"extractLicenses": false,
"vendorChunk": false,
"buildOptimizer": false,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/env-t-as-dev.ts"
}
]
},

The error message I get is:

Error: chunk runtime [entry]
[name].[chunkhash:20].js
Cannot use [chunkhash] or [contenthash] for chunk in '[name].[chunkhash:20].js' (use [hash] instead)

The output when starting npm run t:

[email protected] t C:\Lander\WS\acro-companion
ng serve --configuration env-t --hmr

NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.
See https://webpack.js.org/guides/hot-module-replacement for information on working with HMR for Webpack.
√ Browser application bundle generation complete.

Initial Chunk Files | Names | Size
main.87e56c1cef41d1dd04a8.js | main | 13.56 MB
scripts.5a89a03e4ff2c7112c7a.js | scripts | 792.59 kB
styles.ba3aef632aea3818b705.css, styles.d65507f702fe7fa2a882.js | styles | 629.92 kB
polyfills.393281e7c8dca2995f7a.js | polyfills | 599.22 kB

Lazy Chunk Files | Names | Size
10.c94bbbbf513450bded1e.js | - | 8.49 MB
11.8e7f9d5a9a3527d599ba.js | - | 3.91 MB
2.ee4e1d910842b2bc9d53.js | - | 3.67 MB
5.aba40ac1e17f6ae90313.js | - | 2.65 MB
3.0047cc885a8f54630e75.js | - | 1.75 MB
12.be8b81c87ba52f4c1cb6.js | - | 1.66 MB
8.9cbece9f7cccbc071b45.js | - | 1.42 MB
7.0213051e790fac9d070f.js | - | 1020.27 kB
pdfmake.e425aaa19f1c5c17c59b.js | pdfmake | 850.54 kB
canvg.70b3302f1fe7bfaa248a.js | canvg | 686.51 kB
9.1aa73de7e9b7feaaa461.js | - | 550.95 kB
15.43c1ae4f28a8b8a1de31.js | - | 481.75 kB
13.53efefc2b50a543a2921.js | - | 445.75 kB
39.81c1edb2d934d36d9637.js | - | 429.55 kB
29.1c4163bc2a91a3ac5bd3.js | - | 362.05 kB
16.ec85f7fd69d601d98d76.js | - | 362.01 kB
14.a127f2d0113071d20f03.js | - | 333.20 kB
1.f7d04dbadaccce523ee1.js | - | 284.09 kB
17.db055640101c1f12baf4.js | - | 225.45 kB
18.fc00e2be269c22c64831.js | - | 166.66 kB
26.981214a37cc6df16af8a.js | - | 156.84 kB
22.cc5eb04d23a458da3521.js | - | 153.57 kB
20.7160d783e592c5b1fa99.js | - | 152.56 kB
23.d4ea8861c0d015555d48.js | - | 150.23 kB
19.416d884cdb3b071393f3.js | - | 135.88 kB
30.e28110b4066035ca9dcb.js | - | 110.74 kB
24.6492eb67b0b91802560f.js | - | 105.17 kB
21.56e6e083265b0602a889.js | - | 102.11 kB
25.73d3102fcfcf4b012b25.js | - | 99.94 kB
27.4c323dd33a603060319c.js | - | 60.16 kB
37.f437029c3f903369792d.js | - | 59.56 kB
31.191489484d9f4aecad10.js | - | 48.55 kB
36.c58cb083734472c4bb6a.js | - | 39.19 kB
28.0bb4b6d1d58ceb0abe38.js | - | 38.63 kB
6.67d04dea49d5bdcd4733.js | - | 38.49 kB
4.ff40c05b877acf8b3b72.js | - | 17.17 kB
34.ad836c1d4323896330f9.js | - | 16.54 kB
0.097a350bdfa5192489be.js | - | 13.95 kB
35.3f804bf8354da68479cc.js | - | 12.62 kB
33.aa459fc318ca85120b4c.js | - | 10.29 kB
32.537bdcd13223ef852d6c.js | - | 9.79 kB
common.fb1d0fddb005598b7917.js | common | 4.90 kB
38.134d3c05052980086692.js | - | 4.74 kB

1 unchanged chunks

Build at: 2020-11-15T14:42:46.208Z - Hash: 0527d61eb1e4d752295f - Time: 71214ms

Error: chunk runtime [entry]
[name].[chunkhash:20].js
Cannot use [chunkhash] or [contenthash] for chunk in '[name].[chunkhash:20].js' (use [hash] instead)

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

@clydin
Copy link
Member

clydin commented Nov 15, 2020

Duplicate of #10411

@clydin clydin marked this as a duplicate of #10411 Nov 15, 2020
@clydin clydin closed this as completed Nov 15, 2020
@alvaromartmart
Copy link

I'm facing the same issue

@angular-automatic-lock-bot
Copy link

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

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants