Comments (7)
@timohausmann no, let's keep it open. Dev mode is supported, and as such, we will need it to work properly. This clearly causes it to not.
from serwist.
@Xardasus if you use installSerwist
+ runtimeCaching
like in basically any Next.js example in the docs, please disable runtimeCaching
in development mode:
runtimeCaching: process.env.NODE_ENV === "development" ? undefined : defaultCache,
This feature can cause JS assets to be accidentally outdated, which is not something you want in development mode.
You may also clear the caches just in case.
In Serwist v9, runtimeCaching
will be disabled by default in development mode, but this won't be backported to Serwist v8.
Hope this helps!
from serwist.
Many thanks @DuCanhGH, looks like it's working
from serwist.
Yeah this is an age-old issue, but I have not investigated it. Sounds like something is being unexpectedly cached, though.
from serwist.
It seems to only occur in dev, so maybe I could disable the SW in dev if I'm not working on it.
from serwist.
Since Next' preloading etc. behaves differently in dev mode, I found it best to only test the SW in production build.
const withSerwist = require("@serwist/next").default({
swSrc: "./sw.ts",
swDest: "public/sw.js",
disable: process.env.NODE_ENV === 'development',
});
That solves the issue for me, feel free to close.
from serwist.
I get the same issue, also added disable: process.env.NODE_ENV === 'development',
running dev on Next.js 14.1 "dev": "next dev --experimental-https"
.
Something is getting cached and making it full reload, had to delete caches via the Dev tools.
from serwist.
Related Issues (20)
- [Docs]: Can you update with an example for sub domain like app.acme.com HOT 1
- [Bug]: require() of ES Module not supported when running tests HOT 3
- [Bug]: Googletagmanager fails to load on safari with the default @serwist/next package HOT 6
- [Bug]: Next pages navigation causes stale data HOT 3
- [Bug]: Fetch requests do not go through service worker HOT 4
- [Bug]: Service Worker is installed on a page out of scope. HOT 4
- [Docs]: Next.js, where are the cache expiration settings and similar configuration HOT 8
- [Bug]: Error [ERR_REQUIRE_ESM]: require() of ES Module HOT 2
- [Bug]: serwist tries to install service worker with different name than specified in next config HOT 2
- [Bug]: Problem with old safari version HOT 9
- [Bug]: Logs spammed on console in production HOT 3
- [Bug]: Browser export missing from NextJS package HOT 3
- [Bug]: When using serwist/next with pyodide/webpack-plugin - "TypeError: The 'compilation' argument must be an instance of Compilation" HOT 8
- question about globals in `@serwist/core` and `globals.d.ts` HOT 3
- [Bug]: Type error: An expression of type 'void' cannot be tested for truthiness. HOT 1
- How Can I cache resources from my application to have complete offline feature? HOT 1
- `@serwist/next` - additionalPrecacheEntries prevents automatically precaching public dir files
- [Bug]: Vercel build fails to load next.config.js HOT 1
- Question: Is there a way to disable the precaching?
- [Docs]: Build fails if you follow setup guide Next.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serwist.