Search code examples
.net-corecreate-react-appprogressive-web-appsworkboxsw-precache

CRA precache fails because of .LICENSE extension


So, we have a situation where in production the precache is failing on our PWA because of a weird .LICENSE file on our server that is giving us 404

specifically an error like this

uncaught (in promise) bad-precaching-response: bad-precaching-response :: [{"url"

How we can fix that?


Solution

  • Well, the fix is simple.

    Our web-server returns only known file extensions, and .LICENSE is not one of them.

    Just enable the ServeUnknownFileTypes flag on your StaticFileServer options info