-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Preload config error #146
Comments
@dalist1 huh, not sure how that can happen with It may be the case that some navigation requests got through the service worker (i.e when no route matches the request), resulting in the preloaded responses being discarded. You may add |
Having the same issue. It does appear that page is getting preloaded correctly in a production build though. |
@gsemyong ah... In development mode, |
@DuCanhGH I've changed the snippet to be const serwist = new Serwist({
precacheEntries: self.__SW_MANIFEST,
skipWaiting: true,
clientsClaim: true,
navigationPreload: true,
runtimeCaching:
defaultCache.length === 0
? [
{
matcher: () => true,
handler: new NetworkFirst(),
},
]
: defaultCache,
}); Seems like the warnings are gone. Is that what you meant? |
@gsemyong ...yep. That's what I meant. |
guys, I haven't had time to play around with this recently but will definitely try the networkFirst fallback strategy out later. thanks @gsemyong
|
Provide environment information
The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle.
Which project is this issue for?
serwist
Link to reproduction - Issues with a link to complete (but minimal) reproduction code help us address them faster
.
To reproduce
Error comes out from this config seems like:
const serwist = new Serwist({
precacheEntries: self.__SW_MANIFEST,
skipWaiting: true,
clientsClaim: true,
navigationPreload: true,
runtimeCaching: defaultCache,
})
Describe the bug
Add the above config, and check the console.
Expected behavior
No error is supposed to come up in the console, not sure where the issue exactly lies, here's my nextjs info:
Operating System:
Platform: linux
Arch: x64
Version: #202404301715 SMP PREEMPT_DYNAMIC Tue Apr 30 17:56:17 UTC 2024
Available memory (MB): 64042
Available CPU cores: 16
Binaries:
Node: 21.7.3
npm: 10.5.0
Yarn: 1.22.22
pnpm: 9.1.1
Relevant Packages:
next: 15.0.0-rc.0 // Latest available version is detected (15.0.0-rc.0).
eslint-config-next: 15.0.0-rc.0
react: 19.0.0-rc-f994737d14-20240522
react-dom: 19.0.0-rc-f994737d14-20240522
typescript: 5.4.5
Next.js Config:
output: N/A
Screenshots (if relevant)
.
Additional information (if relevant)
.
The text was updated successfully, but these errors were encountered: