You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Bad-precaching-response with themes/min.css when trying to use EUI next.js Starter for PWA #25
I'm using EUI's Next.js starter and am trying to make this into a PWA -- here is the repo. I haven't done anything crazy different from the EUI starter. Upon running npm run build; npm run start I get workbox-030153e1.js:1 Uncaught (in promise) bad-precaching-response: bad-precaching-response :: [{"url":"http://localhost:3000/public/themes/eui_theme_amsterdam_dark.e7b2d22ec11f782218ad.min.css","status":404}
Which I think results the PWA audit in Lighthouse to fail:
I've also tried next build and have gotten the following error despite my installation of sass in package.json's dependencies and devDependencies:
info - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
info - Checking validity of types
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
info - Creating an optimized production build
Failed to compile.
./src/pages/app.module.scss
Error: Cannot find module 'sass'
Require stack:
- /usr/local/lib/node_modules/next/dist/compiled/sass-loader/cjs.js
- /usr/local/lib/node_modules/next/dist/compiled/webpack/bundle4.js
- /usr/local/lib/node_modules/next/dist/compiled/webpack/webpack.js
- /usr/local/lib/node_modules/next/dist/next-server/server/config-utils.js
- /usr/local/lib/node_modules/next/dist/next-server/server/config.js
- /usr/local/lib/node_modules/next/dist/build/index.js
- /usr/local/lib/node_modules/next/dist/cli/next-build.js
- /usr/local/lib/node_modules/next/dist/bin/next
> Build error occurred
Error: > Build failed because of webpack errors
at /usr/local/lib/node_modules/next/dist/build/index.js:17:924
at async Span.traceAsyncFn (/usr/local/lib/node_modules/next/dist/telemetry/trace/trace.js:5:584)
Activity
thompsongl commentedon Mar 29, 2021
This is just a hunch, but it could be that the theme switching method is the cause. Namely, using
<link disabled />on the unused theme css files.hidesminimally commentedon Mar 30, 2021
Thanks for the suggestion @thompsongl - I tried this with this PR - https://github.com/hidesminimally/engram/pull/1 and am at the same place:

I've also tried
next buildand have gotten the following error despite my installation of sass in package.json's dependencies and devDependencies:Which I think is also a relevant error...
But interestingly enough, when I deploy it to vercel: https://engram-k3raxj6v1-hidesminimally.vercel.app/ it does not have the sass module loading error. Just the same errors as the original post -- 404 for build-manifest.json (and min.css though I've told the caching to ignore those files for now), which prevent the app from becoming a PWA due to the 404 crashing the serviceworker.js
hidesminimally commentedon Mar 30, 2021
Update:
Found a solution for
npm run build; npm run startby excluding.jsonand.min.cssfrom preaching:https://github.com/hidesminimally/engram/pull/1/files#diff-882b2c04b01b2e8b2cdcf1817c30ea503a8005f1c0d54cfff37053b6801fea85R183Although I'm not sure this is totally correct because I see this 404 on the vercel deployment:

https://engram-izzzwf40m-hidesminimally.vercel.app/
And yet it is able to become a PWA.....