When I test it with npm run dev, everything works fine, but if I try to test production build on my local machine with npm run build && npm run start, then I get this error in the browser:
Uncaught (in promise) bad-precaching-response: bad-precaching-response :: [{"url":"http://localhost:3000/static/image/public/images/me.655a7bde7c387da0f74416eed878ae0b.jpg","status":404}]
from workbox-ea903bce.js
and service worker status is redundant
Versions
next-pwa: 5.2.23
next:11.0.0
How To Reproduce
Steps to reproduce the behavior:
Create next.js project
Install next-pwa (I've folowed installation instructions to the letter, no custom server btw)
put some imges into public folder and use them in some page with next/image<Image/> component
run production build and serve with npm run build && npm run star
See error in browser devtools, once you open the page
Link to minimal reproduce setup repository if any.
Expected Behaviors
PWA features work with no errors like in development mode
Summary
When I test it with
npm run dev
, everything works fine, but if I try to test production build on my local machine withnpm run build && npm run start
, then I get this error in the browser:from
workbox-ea903bce.js
and service worker status isredundant
Versions
next-pwa
: 5.2.23next
:11.0.0How To Reproduce
Steps to reproduce the behavior:
next/image
<Image/>
componentnpm run build && npm run star
Link to minimal reproduce setup repository if any.
Expected Behaviors
PWA features work with no errors like in development mode
Additional context
I am using typescript
My next.config.js
Browser: Google Crome Version 91.0.4472.114 (Official Build) (x86_64) OS: MacOS Big Sur 11.4