Skip to content

Build warning /static/js/filename.chunk.js is 3.87 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit. #9987

Description

@chanan

Describe the bug

After updating to v4.0.0 when I build I get the below warning, which causes the build to fail in CI environment:

/static/js/155.6cc63d87.chunk.js is 3.87 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.

The weird thing is that when I build, the output of the build command doesnt show the file to be that size

637.26 KB build\static\js\155.6cc63d87.chunk.js 

However, if I list the file directly it is much bigger than the build output says it is:

-a---- 11/2/2020 8:34 AM 3874415 155.6cc63d87.chunk.js
-a---- 11/2/2020 8:34 AM 4248 155.6cc63d87.chunk.js.LICENSE.txt
-a---- 11/2/2020 8:34 AM 7869621 155.6cc63d87.chunk.js.map

Did you try recovering your dependencies?

Yes. Deleted node_modules, yarn.lock - did not help

Which terms did you search for in User Guide?

n/a

Environment

Environment Info:
current version of create-react-app: 4.0.0
running from C:\Users\cbraunstein\AppData\Roaming\npm-cache\_npx\17108\node_modules\create-react-app
System:
OS: Windows 10 10.0.20246
CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Binaries:
Node: 12.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 86.0.4240.111
Edge: Spartan (44.20246.1.0), ChromiumDev (88.0.680.1)
Internet Explorer: 11.0.20246.1
npmPackages:
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-scripts: 4.0.0 => 4.0.0
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. yarn build

Expected behavior

No warning should be outputted

Actual behavior

A warning is outputted from the build. In case of a CI the build is failed.

Reproducible demo

I can not share this project. I will try to create a blank one and see if I can recreate it.

 ~\..\..\devops   main ≣ ~1 -0 !  yarn build
yarn run v1.22.5
$ react-scripts build
Creating an optimized production build...
Compiled with warnings.
/static/js/155.6cc63d87.chunk.js is 3.87 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
637.26 KB build\static\js\155.6cc63d87.chunk.js
63.52 KB build\static\js\159.768d4811.chunk.js
19.48 KB build\static\js\157.913aa113.chunk.js
11.56 KB build\static\js\156.6ba34070.chunk.js
9.91 KB build\static\js\main.d5a9c99f.chunk.js

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions