question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

1reaction
stale[bot]commented, Jan 9, 2022

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

1reaction
geekinate1commented, Aug 25, 2021

Facing the same issues in deploying the app on netlify

Read more comments on GitHub >

github_iconTop Results From Across the Web

progressive web apps - Won't be precached. Configure ...
WARNING in css/app.css is 4.13 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit. What does the warning ...
Read more >
precached. Configure maximumFileSizeToCacheInBytes to ...
Hi! I'm not 100% sure to have fully understood your question. But if you need to customize that value as mentioned in the...
Read more >
Workaround for cache size limit in Create React...anycodings
After some research I found two issues solutions: eject from CRA; use a tool to override the configuration.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found