this is like a low level resetting of Safari without affecting passwords and bookmarks.
4. If Safari doesn’t open a webpage or isn’t working as expected
https://support.apple.com/en-us/HT204098
Posted on Jul 2, 2021 4:57 AM
Similar questions
Safari NOT Working after MAC OS update to Big Sur Hi,
I had updated MacBook Air OS sometime back and after that I am facing 2 issues:
Safari stopped working. The page never loads and it stays in loading state forever. Mail app behaves in a weird way. It goes in offline mode and does not come back to normal state. I have to quit the Mail app and restart it and then it loads new mails.
Details: MacBook Air (13-inch, Early 2014) Mac OS Big Sur 11.5.2 Safari Version: 14.1.2 (16611.3.10.1.6) Mail Version: 14.0 (3654.120.0.1.13)
182 5
Safari 12.1.2 not working on iMac (nor is Mail) Greetings. When I shut down and then boot up again, Safari works for maybe 3 minutes then stops responding. Repeatedly. I have checked extensions, cleared History, emptied Caches, etc., to no avail.
FYI — Firefox works with no problems, so it’s not a wifi issue.
Curiously, at the same time, Mail stopped functioning as well…..shutting down or restarting has no effect.
Using OS 10.13.6
Thx Robert
170 6
My MacOS High Sierra has rendered Google and other sights useless I keep getting error messages from safari and mail. Error messages keep popping up such as the requested URL could not be retrieved, failed to establish a secure connection, sending me to enter the account password which never gets far enough. So what could be the cause for this and what are fixes?i have tried a few suggestions, but nothing has helped. Google worked fine on 12/16, but no mail since then,I can’t open google or anything related to it on my Mac.
144 1
Safari: FetchEvent.respondWith received an error
Environment
Name
Version
msw
0.25.0
browser
Safari 14.0.2
OS
MacOS Catalina
Request handlers
// Example of declaration. Provide your code here.import{setupWorker}from'msw'consthandlers=[graphql.query('MeQuery',(_req,res,ctx)=>{returnres(ctx.data({
...
}),);}),
...
];constworker=setupWorker(...handlers)worker.start()
Actual request
// Example of making a request. Provide your code here.exportconstgetMe=async()=>{try{constresponse=awaitfetch(MOCK_URL,{headers: {'Content-Type': 'application/json',},method: 'POST',body: meQuery(),});
...
}catch{
...
}};
Current behavior
On Chrome & Firefox, everything is fine. In Safari, it seems like the request gets intercepted, as I see the mock response in the console, but then the service worker throws an error, causing the fetch call to catch with error [Error] FetchEvent.respondWith received an error: Returned response is null. (see screenshot). Not sure why it’s trying to connect to localhost:8642. That’s the local server I run when not using mocks.
Expected behavior
The fetch should return the mock response and not throw an error.
Screenshots
Go step by step and test.
1. Quit Safari, launch Safari holding the Shift key down.
https://support.apple.com/en-us/HT203987
2. Startup in Safe Mode. https://support.apple.com/guide/mac-help/start-up-your-mac-in-safe-mode-mh21245/mac.
Quote:
It also does a basic check of your startup disk, similar to using First Aid in Disk Utility.
And it deletes some system caches, including font caches and
the kernel cache, which are automatically created again as needed.
this is like a low level resetting of Safari without affecting passwords and bookmarks.
4. If Safari doesn’t open a webpage or isn’t working as expected
https://support.apple.com/en-us/HT204098
Posted on Jul 2, 2021 4:57 AM
Similar questions
Safari NOT Working after MAC OS update to Big Sur Hi,
I had updated MacBook Air OS sometime back and after that I am facing 2 issues:
Safari stopped working. The page never loads and it stays in loading state forever. Mail app behaves in a weird way. It goes in offline mode and does not come back to normal state. I have to quit the Mail app and restart it and then it loads new mails.
Details: MacBook Air (13-inch, Early 2014) Mac OS Big Sur 11.5.2 Safari Version: 14.1.2 (16611.3.10.1.6) Mail Version: 14.0 (3654.120.0.1.13)
182 5
Safari 12.1.2 not working on iMac (nor is Mail) Greetings. When I shut down and then boot up again, Safari works for maybe 3 minutes then stops responding. Repeatedly. I have checked extensions, cleared History, emptied Caches, etc., to no avail.
FYI — Firefox works with no problems, so it’s not a wifi issue.
Curiously, at the same time, Mail stopped functioning as well…..shutting down or restarting has no effect.
Using OS 10.13.6
Thx Robert
170 6
My MacOS High Sierra has rendered Google and other sights useless I keep getting error messages from safari and mail. Error messages keep popping up such as the requested URL could not be retrieved, failed to establish a secure connection, sending me to enter the account password which never gets far enough. So what could be the cause for this and what are fixes?i have tried a few suggestions, but nothing has helped. Google worked fine on 12/16, but no mail since then,I can’t open google or anything related to it on my Mac.
144 1
Safari: FetchEvent.respondWith received an error
Environment
Name
Version
msw
0.25.0
browser
Safari 14.0.2
OS
MacOS Catalina
Request handlers
// Example of declaration. Provide your code here.import{setupWorker}from'msw'consthandlers=[graphql.query('MeQuery',(_req,res,ctx)=>{returnres(ctx.data({
...
}),);}),
...
];constworker=setupWorker(...handlers)worker.start()
Actual request
// Example of making a request. Provide your code here.exportconstgetMe=async()=>{try{constresponse=awaitfetch(MOCK_URL,{headers: {'Content-Type': 'application/json',},method: 'POST',body: meQuery(),});
...
}catch{
...
}};
Current behavior
On Chrome & Firefox, everything is fine. In Safari, it seems like the request gets intercepted, as I see the mock response in the console, but then the service worker throws an error, causing the fetch call to catch with error [Error] FetchEvent.respondWith received an error: Returned response is null. (see screenshot). Not sure why it’s trying to connect to localhost:8642. That’s the local server I run when not using mocks.
Expected behavior
The fetch should return the mock response and not throw an error.
Screenshots
Recently I have been working on a PWA for a client. I chose to use Gatsby to build out the front end and luckily it comes with some great plugins to help with building PWAs. Mainly the offline and manifest plugins. After configuring those and building out the proof of concept, I deploy the site to Netlify and started testing on different devices.
It all goes off without a hitch until I get to iPad Safari… Where after adding the app to the Home Screen and playing around with it, I turn off my wifi to test the offline mode. And I am met with this lovely error:
Error: "FetchEvent.respondWith received an error: TypeError: There seems to be no connection to the Internet."
Enter fullscreen mode
Exit fullscreen mode
You are correct error, there is no internet connection, that is the point.
After spending a while Googling, as you do, I found two things.
Apple doesn’t like the term PWA, kinda irrelevant but worth noting.
A LOT of other people were having the same issue.
I tried several StackOverflow and Github solutions, with no luck. Eventually, I decided to go back to basics and create the most bare-bones PWA I could find. Which lead me to this tutorial on Medium by James Johnson. It was the Hello World of PWAs. Literally. Anyway, I followed the tutorial, deployed on Netlify and proceeded to test on iPad, with no issues! So something was wrong with the Gatsby build and not the iPad.
I made two changes to my project, which were all pushed at the same time and ended up fixing my issue. In all honesty, I am not 100% sure which one was the actual fix and at this point, I am too scared to test.
1. I added apple specific metadata
These tags were mentioned in the tutorial I followed above. After looking at the built version of the site, I noticed these apple specific meta tags weren’t being generated.
If you’re not using Gatsby, I’d recommend adding these meta tags in the <head> of your pages, and seeing if it fixes your issue.
I used the react-helmet package to add additional metadata to all my pages. The meta tag that seems the most important would be apple-mobile-web-app-capable.
2. Updated the Workbox globPatterns
In my gatsby-config.js file, I updated the manifest plugin options to include cache_busting_mode: 'none', which is required when you specify a new globPattern. Then under the offline plugin I updated the workboxConfig to be:
I found this pattern while diving into the StackOverflow rabbit hole (I can’t find the link again…).
That is it, after making those changes and pushing the code. The PWA started working on iPad devices. I’d say to test the first change before trying the second one (if you’re using Gatsby), it seems to be the more relevant change.
Hopefully, this has helped you in some way. I spent a few hours looking at this issue so I was pretty happy when it started working. Plus, why not share my solution so other people don’t have to spend hours pulling their hair out.
Peace! ✌️
I created a pwa site which is working totally fine in android devices both online and offline. But it is throwing error FetchEvent.respondWith received an error: Returned response is null when tried to load on IOS device with safari 13.0 if the mobile device is offline.
I created a pwa site which is working totally fine in android devices both online and offline. But it is throwing error FetchEvent.respondWith received an error: Returned response is null when tried to load on IOS device with safari 13.0 if the mobile device is offline.
I can download the website using the service Worker on Android Chrome, macOS Chrome as well as Safari and on Windows Chrome for offline use. When I try to download the website to iOS 12.1 Safari it works first. But when I close Safari, go offline and reopen Safari, I get the following error message:
Safari can’t open the Site.
Error: «FetchEvent.respondWith received an error: TypeError: There
seems to be no connection to the Internet.»
==== AND in the console ====
FetchEvent.respondWith received an error: Returned response is null
Below you can see the scripts in text form. Unfortunately, I can hardly report anything about the problem, because I don’t understand it and hope for some knowledgeable people
/*
Copyright 2014 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
importScripts('cache-polyfill.js');
var CACHE_VERSION = 1;
var CURRENT_CACHES = {
prefetch: 'prefetch-cache-v' + CACHE_VERSION
};
self.addEventListener('install', function(event) {
var now = Date.now();
var urlsToPrefetch = [
'/pwa/index.html'
];
console.log('Handling install event. Resources to prefetch:', urlsToPrefetch);
event.waitUntil(
caches.open(CURRENT_CACHES.prefetch).then(function(cache) {
var cachePromises = urlsToPrefetch.map(function(urlToPrefetch) {
var url = new URL(urlToPrefetch, location.href);
url.search += (url.search ? '&' : '?') + 'cache-bust=' + now;
var request = new Request(url, {mode: 'no-cors'});
return fetch(request).then(function(response) {
if (response.status >= 400) {
throw new Error('request for ' + urlToPrefetch +
' failed with status ' + response.statusText);
}
return cache.put(urlToPrefetch, response);
}).catch(function(error) {
console.error('Not caching ' + urlToPrefetch + ' due to ' + error);
});
});
return Promise.all(cachePromises).then(function() {
console.log('Pre-fetching complete.');
});
}).catch(function(error) {
console.error('Pre-fetching failed:', error);
})
);
});
self.addEventListener('activate', function(event) {
var expectedCacheNames = Object.keys(CURRENT_CACHES).map(function(key) {
return CURRENT_CACHES[key];
});
event.waitUntil(
caches.keys().then(function(cacheNames) {
return Promise.all(
cacheNames.map(function(cacheName) {
if (expectedCacheNames.indexOf(cacheName) === -1) {
console.log('Deleting out of date cache:', cacheName);
return caches.delete(cacheName);
}
})
);
})
);
});
self.addEventListener('fetch', function(event) {
if (!navigator.onLine) {
event.respondWith(
caches.match(event.request).then(function (response) {
if (response) {
return response;
}
console.log('No response found in cache. About to fetch from network...');
return fetch(event.request).then(function (response) {
console.log('Response from network is:', response);
return response;
}).catch(function (error) {
console.error('Fetching failed:', error);
throw error;
});
})
);
}
});
Содержание
Question: Q: fetchevent
Helpful answers
Safari bug #1730
Comments
dijonkitchen commented Oct 23, 2018 •
jeffposnick commented Oct 23, 2018
dijonkitchen commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018 •
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
oliviertassinari commented Oct 24, 2018
oliviertassinari commented Nov 6, 2018 •
dijs commented Nov 14, 2018
jeffposnick commented Nov 19, 2018
Question: Q: fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Helpful answers
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Dec 1, 2018 2:17 AM
There’s more to the conversation
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
Nov 30, 2018 10:10 AM
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Browser & Platform: Safari 12 macOS High Sierra 10.13.6
Issue or Feature Request Description: Refreshing workbox PWAs (like https://material-ui.com) leads to this sometimes.
Confirmed that they work fine on Firefox, Chrome and private mode Safari.
I figured if I cleared the cache, it would help, but it doesn’t seem to kill the service workers. Workaround is to disable service workers in Developer mode and I can load the websites properly.
The text was updated successfully, but these errors were encountered:
I just testing things out on Safari 12 on the desktop, and was not able to reproduce after navigating around to a few pages controlled by the service worker on https://material-ui.com. So, if there are any concrete reproduction steps that you’ve been able to narrow down, I’d love to dig in deeper.
In the meantime, though, I’ve noticed that you’re using a v3.0.0 pre-release version of Workbox. Workbox is up to v3.6.3 now (and we’ve got v4 alphas out), so as a first step, could you try upgrading your copy of Workbox? There were a number of improvements made throughout the v3 releases, and I’d like to at least make sure that we’re starting from the latest codebase.
Thanks @jeffposnick, I don’t control the site, so I’ll cross-post there.
@jeffposnick did you also trying refreshing pages? This should be when the Service workers do their work using the cache instead of routing through the single-page app.
Yes, I’ve tried a few times now to go through full navigations as well as page reloads and trigger any failures in Safari 12. I’ve not had any luck.
(That’s not to say that there isn’t an issue; it’s just that odd bugs can crop up in browsers’ implementations of service workers that are hard to trigger.)
This is iOS 12 Safari bug.
(It isn’t fixed in 12.0.1)
As per the initial issue report, I was working under the assumption that this was being seen on the desktop (Safari 12 / macOS High Sierra 10.13.6).
@jeffposnick hmm.. yeah, indeed. Then it must be the same bug on macOS as well because the error line is the same as on iOS when this happens.
Yes, my error was on macOS Safari. For what it’s worth, I tried it out on another laptop that recently upgraded to macOS Mojave and Safari there was fine.
We gonna start by upgrading the version of workbox on material-ui side.
We have been upgrading the version of workbox from the beta to the latest version. It hasn’t gone smoothly, a lot of people were facing cache invalidation issues. This is something that happens quite often every time we release a new version. It takes time to propagate. The cache invalidation is an important limitation of the service workers.
I’m suspecting it’s because of the next service worker waiting for its activation. Maybe there is a way to force it? At the expense of an unexpected full page reload when the user tries to refresh the page or to navigate to a different page. I will explore this path: https://developers.google.com/web/tools/workbox/guides/advanced-recipes.
Our team recently found this issue as well. Is the solution to upgrade workbox?
Our team recently found this issue as well. Is the solution to upgrade workbox?
The material-ui site was using a very outdated Workbox v3 beta, so updating was a good idea in general.
More recent versions of Workbox have had better «cache miss» fallback logic to take into account the fact that items that should be precached aren’t necessarily going to be there (due to browser bugs, or other failure scenarios), so they are more robust about at least showing something from the network when this crops up, instead of just failing to load the cached response.
But in general, my understanding is that this underlying issue a bug in Safari and is outside of Workbox’s control, and which is being tracked by the Webkit bugs linked to above.
Источник
fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Similar questions
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Dropbox.app (Dropbox, Inc. — installed 2018-11-29)
StartUpHelper (Spotify — installed 2018-07-17)
iTunesHelper.app (Apple — installed 2018-10-30)
Internet Plug-ins:
Silverlight: 5.1.50901.0 (installed 2018-09-30)
AdobeAAMDetect: 3.0.0.0 (installed 2018-06-14)
QuickTime Plugin: 7.7.3 (installed 2018-10-30)
Time Machine:
Time Machine information not available without Full Drive Access.
Performance:
System Load: 1.55 (1 min ago) 2.27 (5 min ago) 1.22 (15 min ago)
Nominal I/O speed: 10.06 MB/s
File system: 18.71 seconds
Write speed: 1959 MB/s
Read speed: 2677 MB/s
CPU Usage:
Type
Overall
Individual cores
System
1 %
4 %
0 %
2 %
0 %
2 %
0 %
1 %
0 %
User
2 %
5 %
0 %
3 %
0 %
3 %
0 %
1 %
0 %
Idle
97 %
90 %
100 %
94 %
100 %
96 %
100 %
98 %
100 %
Top Processes by CPU:
Process (count)
Source
CPU
Location
genatsdb
Apple
31.00 %
appstoreagent
Apple
16.20 %
WindowServer
Apple
7.92 %
EtreCheckPro
Etresoft, Inc.
5.58 %
cloudphotosd
Apple
4.58 %
Top Processes by Memory:
Process (count)
Source
RAM usage
Location
com.apple.WebKit.WebContent (9)
Apple
1.05 GB
EtreCheckPro
Etresoft, Inc.
593 MB
mdworker_shared (18)
Apple
509 MB
kernel_task
Apple
400 MB
Spotify Helper (3)
Spotify
301 MB
Top Processes by Network Use:
Process
Source
Input
Output
Location
Spotify
Spotify
11 MB
321 KB
biometrickitd
Apple
20 KB
167 KB
Dropbox
Dropbox, Inc.
93 KB
91 KB
com.apple.iCloudHelper
Apple
39 KB
8 KB
mDNSResponder
Apple
25 KB
20 KB
Virtual Memory Information:
Available RAM
10.01 GB
Free RAM
6.50 GB
Used RAM
5.99 GB
Cached files
3.51 GB
Swap Used
0 B
Software Installs (past 30 days):
Name
Version
Install Date
Microsoft Outlook for Mac
16.16.18111001
2018-11-14
Microsoft PowerPoint for Mac
16.16.18111001
2018-11-14
Microsoft OneNote for Mac
16.16.18111001
2018-11-14
Microsoft Excel for Mac
16.16.18111001
2018-11-14
Microsoft Word for Mac
16.16.18111001
2018-11-14
Microsoft AutoUpdate
4.5.18110402
2018-11-15
HueMenu
1.9.1
2018-11-17
Diagnostics Information (past 7 days):
2018-11-30 20:54:48 Last Shutdown Cause: 3 — Hard shutdown
Источник
Service Worker FechtEvent.respondWith response имеет значение null в Safari iOS 12.1
Я могу загрузить веб-сайт с помощью службы Worker в Android Chrome, macOS Chrome, а также в Safari и в Windows Chrome для автономного использования. Когда я пытаюсь загрузить сайт на iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, перехожу в автономный режим и снова открываю Safari, я получаю следующий сообщение об ошибке:
Error: «FetchEvent.respondWith received an error: TypeError: There seems to be no connection to the Internet.»
==== AND in the console ====
FetchEvent.respondWith received an error: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, почти ничего не могу сообщить о проблеме, потому что не понимаю и надеюсь на кого-нибудь знающих 🙂
Я протестировал сценарий на нескольких iPhone (12.0, 12.0.1 (16A404), а также 12.1 (16B92)), и на всех из них я мог загрузить веб-приложение и снова открыть его в автономном режиме. В настоящее время я подозреваю, что на iPhone, у которых включены следующие настройки, у PWA есть проблемы с повторным поиском кеша: 1. Не разрешать кеш и 2. Ограниченный iphone (родительский контроль). После того, как я разрешил кешу работать, он все еще не работал. Работа. Я не мог отключить ограниченный режим, потому что владелец больше не знает код.
Я понял, что, разместив сайт через xampp и посетив его со своего телефона (iOS 12.1.1), я могу посещать его в автономном режиме. При обслуживании на моем сервере с nginx я также получаю ту же ошибку, о которой вы говорили. У меня пока нет решения, но, возможно, эта информация может вам помочь.
Вы когда-нибудь находили решение этой проблемы или в чем была проблема? Я несколько дней застревал с этой ошибкой и не нашел решения, с чего начать поиск.
Извините, до сих пор решение этой проблемы не найдено. Это случилось только на одном устройстве, поэтому я решил продолжить. Если хотите, можете попробовать перезагрузить iphone. До сих пор я предполагаю, что это сбой в конфигурации конфиденциальности в телефоне.
Источник
Ответ Service Worker FechtEvent.respondWith является нулевым на iOS 12.1 Safari
Я могу загрузить веб-сайт с помощью службы Worker на Android Chrome, macOS Chrome, а также Safari и на Windows Chrome для автономного использования. Когда я пытаюсь загрузить веб-сайт в iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, выхожу в автономный режим и снова открываю Safari, я получаю следующее сообщение об ошибке:
Safari can’t open the Site.
Ошибка: «FetchEvent.respondWith получил ошибку: TypeError: There похоже, нет соединения с Интернетом.»
FetchEvent.respondWith получил ошибку: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, я вряд ли смогу что-то сообщить о проблеме, потому что я ее не понимаю и надеюсь на знающих людей 🙂
Извините, что у меня пока нет ответа, но у меня точно такая же проблема с моим веб-приложением, и я потратил на нее несколько часов. Поэтому я хотел бы опубликовать здесь все свои выводы.
Шаги для проверки возможности работы веб-приложения в автономном режиме в iOS 12
зайдите на веб-сайт в Safari (iOS 12 или 12.1)
закройте вкладку веб-сайта в Safari
нажмите кнопку «Домой» на iPhone, чтобы перевести Safari в фоновый режим
нажмите кнопку питания iPhone, чтобы выключить экран
нажмите кнопку питания iPhone еще раз, чтобы разбудить телефон
отключите все сетевые подключения в центре управления iPhone (как wifi, так и сотовую связь)
откройте Safari, снова зайдите на сайт -> он должен работать в автономном режиме.
iOS 12 против iOS 11.3
Похоже, что эта проблема появилась с iOS 12. Мое веб-приложение (https://viewsbyme.com) прекрасно работало в автономном режиме на iOS 11.3, в версии которой мобильный Safari впервые представил Service Worker, но получало отклики от iOS 12 и iOS 12.1 в автономном режиме:
Safari не может открыть страницу. Ошибка гласила: «FetchEvent.respondWith получил ошибку: TypeError: Интернет-соединение, похоже, находится в автономном режиме.».
Не уверен, что это связано с этим сообщением об ошибке (в нем говорится «RESOLVED FIXED», но на самом деле еще нет, если вы прокрутите страницу до самого низа):
Примеры работающих и неработающих веб-приложений
В качестве примеров эти 2 PWA могут работать в автономном режиме в iOS 12:
И эти 2 PWA не могут работать в автономном режиме в iOS 12 (но они прекрасно работают в Chrome на других платформах):
Это кажется простым делом — сравнить скрипты Service Worker между этими PWA и выяснить, что заставляет их работать, а что нет. Но я все еще не выяснил дельту.
Источник
The respondWith() method of FetchEvent prevents the browser’s default fetch handling, and allows you to provide a promise for a Response yourself.
In most cases you can provide any response that the receiver understands. For example, if an <img> initiates the request, the response body needs to be image data. For security reasons, there are a few global rules:
You can only return Response objects of type «opaque» if the fetchEvent.request object’s mode is «no-cors«. This prevents the leaking of private data.
You can only return Response objects of type «opaqueredirect» if the fetchEvent.request object’s mode is «manual«.
You cannot return Response objects of type «cors» if the fetchEvent.request object’s mode is «same-origin«.
Specifying the final URL of a resource
From Firefox 59 onwards, when a service worker provides a Response to FetchEvent.respondWith(), the Response.url value will be propagated to the intercepted network request as the final resolved URL. If the Response.url value is the empty string, then the FetchEvent.request.url is used as the final URL.
In the past the FetchEvent.request.url was used as the final URL in all cases. The provided Response.url was effectively ignored.
This means, for example, if a service worker intercepts a stylesheet or worker script, then the provided Response.url will be used to resolve any relative @import or importScripts() subresource loads (bug 1222008).
For most types of network request this change has no impact because you can’t observe the final URL. There are a few, though, where it does matter:
If a fetch() is intercepted, then you can observe the final URL on the result’s Response.url.
If a worker script is intercepted, then the final URL is used to set self.location and used as the base URL for relative URLs in the worker script.
If a stylesheet is intercepted, then the final URL is used as the base URL for resolving relative @import loads.
Note that navigation requests for Windows and iframes do NOT use the final URL. The way the HTML specification handles redirects for navigations ends up using the request URL for the resulting Window.location. This means sites can still provide an «alternate» view of a web page when offline without changing the user-visible URL.
Syntax
Parameters
response
A Response or a Promise that resolves to a Response. Otherwise, a network error is returned to Fetch.
Return value
Exceptions
NetworkErrorDOMException
Returned if a network error is triggered on certain combinations of FetchEvent.request.mode and Response.type values, as hinted at in the «global rules» listed above.
InvalidStateErrorDOMException
Returned if the event has not been dispatched or respondWith() has already been invoked.
Examples
This fetch event tries to return a response from the cache API, falling back to the
network otherwise.
addEventListener('fetch',(event)=>{// Prevent the default, and handle the request ourselves.
event.respondWith((async()=>{// Try to get the response from a cache.const cachedResponse =await caches.match(event.request);// Return it if we found one.if(cachedResponse)return cachedResponse;// If we didn't find a match in the cache, use the network.returnfetch(event.request);})());});
// Example of declaration. Provide your code here.import{setupWorker}from'msw'consthandlers=[graphql.query('MeQuery',(_req,res,ctx)=>{returnres(ctx.data({
...
}),);}),
...
];constworker=setupWorker(...handlers)worker.start()
Actual request
// Example of making a request. Provide your code here.exportconstgetMe=async()=>{try{constresponse=awaitfetch(MOCK_URL,{headers: {'Content-Type': 'application/json',},method: 'POST',body: meQuery(),});
...
}catch{
...
}};
Current behavior
On Chrome & Firefox, everything is fine. In Safari, it seems like the request gets intercepted, as I see the mock response in the console, but then the service worker throws an error, causing the fetch call to catch with error [Error] FetchEvent.respondWith received an error: Returned response is null. (see screenshot). Not sure why it’s trying to connect to localhost:8642. That’s the local server I run when not using mocks.
Expected behavior
The fetch should return the mock response and not throw an error.
this is like a low level resetting of Safari without affecting passwords and bookmarks.
4. If Safari doesn’t open a webpage or isn’t working as expected
https://support.apple.com/en-us/HT204098
Posted on Jul 2, 2021 4:57 AM
Similar questions
Safari NOT Working after MAC OS update to Big Sur Hi,
I had updated MacBook Air OS sometime back and after that I am facing 2 issues:
Safari stopped working. The page never loads and it stays in loading state forever.
Mail app behaves in a weird way. It goes in offline mode and does not come back to normal state. I have to quit the Mail app and restart it and then it loads new mails.
Details:
MacBook Air (13-inch, Early 2014)
Mac OS Big Sur 11.5.2
Safari Version: 14.1.2 (16611.3.10.1.6)
Mail Version: 14.0 (3654.120.0.1.13)
260 5
Safari 12.1.2 not working on iMac (nor is Mail) Greetings. When I shut down and then boot up again, Safari works for maybe 3 minutes then stops responding. Repeatedly. I have checked extensions, cleared History, emptied Caches, etc., to no avail.
FYI — Firefox works with no problems, so it’s not a wifi issue.
Curiously, at the same time, Mail stopped functioning as well…..shutting down or restarting has no effect.
Using OS 10.13.6
Thx
Robert
211 6
My MacOS High Sierra has rendered Google and other sights useless I keep getting error messages from safari and mail. Error messages keep popping up such as the requested URL could not be retrieved, failed to establish a secure connection, sending me to enter the account password which never gets far enough. So what could be the cause for this and what are fixes?i have tried a few suggestions, but nothing has helped. Google worked fine on 12/16, but no mail since then,I can’t open google or anything related to it on my Mac.
Service Worker FechtEvent.respondWith response имеет значение null в Safari iOS 12.1
Ответ Service Worker FechtEvent.respondWith является нулевым на iOS 12.1 Safari
fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Similar questions
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Dropbox.app (Dropbox, Inc. — installed 2018-11-29)
StartUpHelper (Spotify — installed 2018-07-17)
iTunesHelper.app (Apple — installed 2018-10-30)
Internet Plug-ins:
Silverlight: 5.1.50901.0 (installed 2018-09-30)
AdobeAAMDetect: 3.0.0.0 (installed 2018-06-14)
QuickTime Plugin: 7.7.3 (installed 2018-10-30)
Time Machine:
Time Machine information not available without Full Drive Access.
Performance:
System Load: 1.55 (1 min ago) 2.27 (5 min ago) 1.22 (15 min ago)
Nominal I/O speed: 10.06 MB/s
File system: 18.71 seconds
Write speed: 1959 MB/s
Read speed: 2677 MB/s
CPU Usage:
Type
Overall
Individual cores
System
1 %
4 %
0 %
2 %
0 %
2 %
0 %
1 %
0 %
User
2 %
5 %
0 %
3 %
0 %
3 %
0 %
1 %
0 %
Idle
97 %
90 %
100 %
94 %
100 %
96 %
100 %
98 %
100 %
Top Processes by CPU:
Process (count)
Source
CPU
Location
genatsdb
Apple
31.00 %
appstoreagent
Apple
16.20 %
WindowServer
Apple
7.92 %
EtreCheckPro
Etresoft, Inc.
5.58 %
cloudphotosd
Apple
4.58 %
Top Processes by Memory:
Process (count)
Source
RAM usage
Location
com.apple.WebKit.WebContent (9)
Apple
1.05 GB
EtreCheckPro
Etresoft, Inc.
593 MB
mdworker_shared (18)
Apple
509 MB
kernel_task
Apple
400 MB
Spotify Helper (3)
Spotify
301 MB
Top Processes by Network Use:
Process
Source
Input
Output
Location
Spotify
Spotify
11 MB
321 KB
biometrickitd
Apple
20 KB
167 KB
Dropbox
Dropbox, Inc.
93 KB
91 KB
com.apple.iCloudHelper
Apple
39 KB
8 KB
mDNSResponder
Apple
25 KB
20 KB
Virtual Memory Information:
Available RAM
10.01 GB
Free RAM
6.50 GB
Used RAM
5.99 GB
Cached files
3.51 GB
Swap Used
0 B
Software Installs (past 30 days):
Name
Version
Install Date
Microsoft Outlook for Mac
16.16.18111001
2018-11-14
Microsoft PowerPoint for Mac
16.16.18111001
2018-11-14
Microsoft OneNote for Mac
16.16.18111001
2018-11-14
Microsoft Excel for Mac
16.16.18111001
2018-11-14
Microsoft Word for Mac
16.16.18111001
2018-11-14
Microsoft AutoUpdate
4.5.18110402
2018-11-15
HueMenu
1.9.1
2018-11-17
Diagnostics Information (past 7 days):
2018-11-30 20:54:48 Last Shutdown Cause: 3 — Hard shutdown
Источник
Service Worker FechtEvent.respondWith response имеет значение null в Safari iOS 12.1
Я могу загрузить веб-сайт с помощью службы Worker в Android Chrome, macOS Chrome, а также в Safari и в Windows Chrome для автономного использования. Когда я пытаюсь загрузить сайт на iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, перехожу в автономный режим и снова открываю Safari, я получаю следующий сообщение об ошибке:
Error: «FetchEvent.respondWith received an error: TypeError: There seems to be no connection to the Internet.»
==== AND in the console ====
FetchEvent.respondWith received an error: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, почти ничего не могу сообщить о проблеме, потому что не понимаю и надеюсь на кого-нибудь знающих 🙂
Я протестировал сценарий на нескольких iPhone (12.0, 12.0.1 (16A404), а также 12.1 (16B92)), и на всех из них я мог загрузить веб-приложение и снова открыть его в автономном режиме. В настоящее время я подозреваю, что на iPhone, у которых включены следующие настройки, у PWA есть проблемы с повторным поиском кеша: 1. Не разрешать кеш и 2. Ограниченный iphone (родительский контроль). После того, как я разрешил кешу работать, он все еще не работал. Работа. Я не мог отключить ограниченный режим, потому что владелец больше не знает код.
Я понял, что, разместив сайт через xampp и посетив его со своего телефона (iOS 12.1.1), я могу посещать его в автономном режиме. При обслуживании на моем сервере с nginx я также получаю ту же ошибку, о которой вы говорили. У меня пока нет решения, но, возможно, эта информация может вам помочь.
Вы когда-нибудь находили решение этой проблемы или в чем была проблема? Я несколько дней застревал с этой ошибкой и не нашел решения, с чего начать поиск.
Извините, до сих пор решение этой проблемы не найдено. Это случилось только на одном устройстве, поэтому я решил продолжить. Если хотите, можете попробовать перезагрузить iphone. До сих пор я предполагаю, что это сбой в конфигурации конфиденциальности в телефоне.
Источник
Ответ Service Worker FechtEvent.respondWith является нулевым на iOS 12.1 Safari
Я могу загрузить веб-сайт с помощью службы Worker на Android Chrome, macOS Chrome, а также Safari и на Windows Chrome для автономного использования. Когда я пытаюсь загрузить веб-сайт в iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, выхожу в автономный режим и снова открываю Safari, я получаю следующее сообщение об ошибке:
Safari can’t open the Site.
Ошибка: «FetchEvent.respondWith получил ошибку: TypeError: There похоже, нет соединения с Интернетом.»
FetchEvent.respondWith получил ошибку: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, я вряд ли смогу что-то сообщить о проблеме, потому что я ее не понимаю и надеюсь на знающих людей 🙂
Извините, что у меня пока нет ответа, но у меня точно такая же проблема с моим веб-приложением, и я потратил на нее несколько часов. Поэтому я хотел бы опубликовать здесь все свои выводы.
Шаги для проверки возможности работы веб-приложения в автономном режиме в iOS 12
зайдите на веб-сайт в Safari (iOS 12 или 12.1)
закройте вкладку веб-сайта в Safari
нажмите кнопку «Домой» на iPhone, чтобы перевести Safari в фоновый режим
нажмите кнопку питания iPhone, чтобы выключить экран
нажмите кнопку питания iPhone еще раз, чтобы разбудить телефон
отключите все сетевые подключения в центре управления iPhone (как wifi, так и сотовую связь)
откройте Safari, снова зайдите на сайт -> он должен работать в автономном режиме.
iOS 12 против iOS 11.3
Похоже, что эта проблема появилась с iOS 12. Мое веб-приложение (https://viewsbyme.com) прекрасно работало в автономном режиме на iOS 11.3, в версии которой мобильный Safari впервые представил Service Worker, но получало отклики от iOS 12 и iOS 12.1 в автономном режиме:
Safari не может открыть страницу. Ошибка гласила: «FetchEvent.respondWith получил ошибку: TypeError: Интернет-соединение, похоже, находится в автономном режиме.».
Не уверен, что это связано с этим сообщением об ошибке (в нем говорится «RESOLVED FIXED», но на самом деле еще нет, если вы прокрутите страницу до самого низа):
Примеры работающих и неработающих веб-приложений
В качестве примеров эти 2 PWA могут работать в автономном режиме в iOS 12:
И эти 2 PWA не могут работать в автономном режиме в iOS 12 (но они прекрасно работают в Chrome на других платформах):
Это кажется простым делом — сравнить скрипты Service Worker между этими PWA и выяснить, что заставляет их работать, а что нет. Но я все еще не выяснил дельту.
Источник
Содержание
Question: Q: fetchevent
Helpful answers
Safari bug #1730
Comments
dijonkitchen commented Oct 23, 2018 •
jeffposnick commented Oct 23, 2018
dijonkitchen commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018 •
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
oliviertassinari commented Oct 24, 2018
oliviertassinari commented Nov 6, 2018 •
dijs commented Nov 14, 2018
jeffposnick commented Nov 19, 2018
Question: Q: fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Helpful answers
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Dec 1, 2018 2:17 AM
There’s more to the conversation
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
Nov 30, 2018 10:10 AM
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Browser & Platform: Safari 12 macOS High Sierra 10.13.6
Issue or Feature Request Description: Refreshing workbox PWAs (like https://material-ui.com) leads to this sometimes.
Confirmed that they work fine on Firefox, Chrome and private mode Safari.
I figured if I cleared the cache, it would help, but it doesn’t seem to kill the service workers. Workaround is to disable service workers in Developer mode and I can load the websites properly.
The text was updated successfully, but these errors were encountered:
I just testing things out on Safari 12 on the desktop, and was not able to reproduce after navigating around to a few pages controlled by the service worker on https://material-ui.com. So, if there are any concrete reproduction steps that you’ve been able to narrow down, I’d love to dig in deeper.
In the meantime, though, I’ve noticed that you’re using a v3.0.0 pre-release version of Workbox. Workbox is up to v3.6.3 now (and we’ve got v4 alphas out), so as a first step, could you try upgrading your copy of Workbox? There were a number of improvements made throughout the v3 releases, and I’d like to at least make sure that we’re starting from the latest codebase.
Thanks @jeffposnick, I don’t control the site, so I’ll cross-post there.
@jeffposnick did you also trying refreshing pages? This should be when the Service workers do their work using the cache instead of routing through the single-page app.
Yes, I’ve tried a few times now to go through full navigations as well as page reloads and trigger any failures in Safari 12. I’ve not had any luck.
(That’s not to say that there isn’t an issue; it’s just that odd bugs can crop up in browsers’ implementations of service workers that are hard to trigger.)
This is iOS 12 Safari bug.
(It isn’t fixed in 12.0.1)
As per the initial issue report, I was working under the assumption that this was being seen on the desktop (Safari 12 / macOS High Sierra 10.13.6).
@jeffposnick hmm.. yeah, indeed. Then it must be the same bug on macOS as well because the error line is the same as on iOS when this happens.
Yes, my error was on macOS Safari. For what it’s worth, I tried it out on another laptop that recently upgraded to macOS Mojave and Safari there was fine.
We gonna start by upgrading the version of workbox on material-ui side.
We have been upgrading the version of workbox from the beta to the latest version. It hasn’t gone smoothly, a lot of people were facing cache invalidation issues. This is something that happens quite often every time we release a new version. It takes time to propagate. The cache invalidation is an important limitation of the service workers.
I’m suspecting it’s because of the next service worker waiting for its activation. Maybe there is a way to force it? At the expense of an unexpected full page reload when the user tries to refresh the page or to navigate to a different page. I will explore this path: https://developers.google.com/web/tools/workbox/guides/advanced-recipes.
Our team recently found this issue as well. Is the solution to upgrade workbox?
Our team recently found this issue as well. Is the solution to upgrade workbox?
The material-ui site was using a very outdated Workbox v3 beta, so updating was a good idea in general.
More recent versions of Workbox have had better «cache miss» fallback logic to take into account the fact that items that should be precached aren’t necessarily going to be there (due to browser bugs, or other failure scenarios), so they are more robust about at least showing something from the network when this crops up, instead of just failing to load the cached response.
But in general, my understanding is that this underlying issue a bug in Safari and is outside of Workbox’s control, and which is being tracked by the Webkit bugs linked to above.
// Example of declaration. Provide your code here.import{setupWorker}from'msw'consthandlers=[graphql.query('MeQuery',(_req,res,ctx)=>{returnres(ctx.data({
...
}),);}),
...
];constworker=setupWorker(...handlers)worker.start()
Actual request
// Example of making a request. Provide your code here.exportconstgetMe=async()=>{try{constresponse=awaitfetch(MOCK_URL,{headers: {'Content-Type': 'application/json',},method: 'POST',body: meQuery(),});
...
}catch{
...
}};
Current behavior
On Chrome & Firefox, everything is fine. In Safari, it seems like the request gets intercepted, as I see the mock response in the console, but then the service worker throws an error, causing the fetch call to catch with error [Error] FetchEvent.respondWith received an error: Returned response is null. (see screenshot). Not sure why it’s trying to connect to localhost:8642. That’s the local server I run when not using mocks.
Expected behavior
The fetch should return the mock response and not throw an error.
Screenshots
Recently I have been working on a PWA for a client. I chose to use Gatsby to build out the front end and luckily it comes with some great plugins to help with building PWAs. Mainly the offline and manifest plugins. After configuring those and building out the proof of concept, I deploy the site to Netlify and started testing on different devices.
It all goes off without a hitch until I get to iPad Safari… Where after adding the app to the Home Screen and playing around with it, I turn off my wifi to test the offline mode. And I am met with this lovely error:
Error: "FetchEvent.respondWith received an error: TypeError: There seems to be no connection to the Internet."
Enter fullscreen mode
Exit fullscreen mode
You are correct error, there is no internet connection, that is the point.
After spending a while Googling, as you do, I found two things.
Apple doesn’t like the term PWA, kinda irrelevant but worth noting.
A LOT of other people were having the same issue.
I tried several StackOverflow and Github solutions, with no luck. Eventually, I decided to go back to basics and create the most bare-bones PWA I could find. Which lead me to this tutorial on Medium by James Johnson. It was the Hello World of PWAs. Literally. Anyway, I followed the tutorial, deployed on Netlify and proceeded to test on iPad, with no issues! So something was wrong with the Gatsby build and not the iPad.
I made two changes to my project, which were all pushed at the same time and ended up fixing my issue. In all honesty, I am not 100% sure which one was the actual fix and at this point, I am too scared to test.
1. I added apple specific metadata
These tags were mentioned in the tutorial I followed above. After looking at the built version of the site, I noticed these apple specific meta tags weren’t being generated.
If you’re not using Gatsby, I’d recommend adding these meta tags in the <head> of your pages, and seeing if it fixes your issue.
I used the react-helmet package to add additional metadata to all my pages. The meta tag that seems the most important would be apple-mobile-web-app-capable.
2. Updated the Workbox globPatterns
In my gatsby-config.js file, I updated the manifest plugin options to include cache_busting_mode: 'none', which is required when you specify a new globPattern. Then under the offline plugin I updated the workboxConfig to be:
I found this pattern while diving into the StackOverflow rabbit hole (I can’t find the link again…).
That is it, after making those changes and pushing the code. The PWA started working on iPad devices. I’d say to test the first change before trying the second one (if you’re using Gatsby), it seems to be the more relevant change.
Hopefully, this has helped you in some way. I spent a few hours looking at this issue so I was pretty happy when it started working. Plus, why not share my solution so other people don’t have to spend hours pulling their hair out.
Peace! ✌️
Содержание
fetchevent
Similar questions
Service Worker FechtEvent.respondWith response имеет значение null в Safari iOS 12.1
Ответ Service Worker FechtEvent.respondWith является нулевым на iOS 12.1 Safari
fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Similar questions
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Dropbox.app (Dropbox, Inc. — installed 2018-11-29)
StartUpHelper (Spotify — installed 2018-07-17)
iTunesHelper.app (Apple — installed 2018-10-30)
Internet Plug-ins:
Silverlight: 5.1.50901.0 (installed 2018-09-30)
AdobeAAMDetect: 3.0.0.0 (installed 2018-06-14)
QuickTime Plugin: 7.7.3 (installed 2018-10-30)
Time Machine:
Time Machine information not available without Full Drive Access.
Performance:
System Load: 1.55 (1 min ago) 2.27 (5 min ago) 1.22 (15 min ago)
Nominal I/O speed: 10.06 MB/s
File system: 18.71 seconds
Write speed: 1959 MB/s
Read speed: 2677 MB/s
CPU Usage:
Type
Overall
Individual cores
System
1 %
4 %
0 %
2 %
0 %
2 %
0 %
1 %
0 %
User
2 %
5 %
0 %
3 %
0 %
3 %
0 %
1 %
0 %
Idle
97 %
90 %
100 %
94 %
100 %
96 %
100 %
98 %
100 %
Top Processes by CPU:
Process (count)
Source
CPU
Location
genatsdb
Apple
31.00 %
appstoreagent
Apple
16.20 %
WindowServer
Apple
7.92 %
EtreCheckPro
Etresoft, Inc.
5.58 %
cloudphotosd
Apple
4.58 %
Top Processes by Memory:
Process (count)
Source
RAM usage
Location
com.apple.WebKit.WebContent (9)
Apple
1.05 GB
EtreCheckPro
Etresoft, Inc.
593 MB
mdworker_shared (18)
Apple
509 MB
kernel_task
Apple
400 MB
Spotify Helper (3)
Spotify
301 MB
Top Processes by Network Use:
Process
Source
Input
Output
Location
Spotify
Spotify
11 MB
321 KB
biometrickitd
Apple
20 KB
167 KB
Dropbox
Dropbox, Inc.
93 KB
91 KB
com.apple.iCloudHelper
Apple
39 KB
8 KB
mDNSResponder
Apple
25 KB
20 KB
Virtual Memory Information:
Available RAM
10.01 GB
Free RAM
6.50 GB
Used RAM
5.99 GB
Cached files
3.51 GB
Swap Used
0 B
Software Installs (past 30 days):
Name
Version
Install Date
Microsoft Outlook for Mac
16.16.18111001
2018-11-14
Microsoft PowerPoint for Mac
16.16.18111001
2018-11-14
Microsoft OneNote for Mac
16.16.18111001
2018-11-14
Microsoft Excel for Mac
16.16.18111001
2018-11-14
Microsoft Word for Mac
16.16.18111001
2018-11-14
Microsoft AutoUpdate
4.5.18110402
2018-11-15
HueMenu
1.9.1
2018-11-17
Diagnostics Information (past 7 days):
2018-11-30 20:54:48 Last Shutdown Cause: 3 — Hard shutdown
Источник
Service Worker FechtEvent.respondWith response имеет значение null в Safari iOS 12.1
Я могу загрузить веб-сайт с помощью службы Worker в Android Chrome, macOS Chrome, а также в Safari и в Windows Chrome для автономного использования. Когда я пытаюсь загрузить сайт на iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, перехожу в автономный режим и снова открываю Safari, я получаю следующий сообщение об ошибке:
Error: «FetchEvent.respondWith received an error: TypeError: There seems to be no connection to the Internet.»
==== AND in the console ====
FetchEvent.respondWith received an error: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, почти ничего не могу сообщить о проблеме, потому что не понимаю и надеюсь на кого-нибудь знающих 🙂
Я протестировал сценарий на нескольких iPhone (12.0, 12.0.1 (16A404), а также 12.1 (16B92)), и на всех из них я мог загрузить веб-приложение и снова открыть его в автономном режиме. В настоящее время я подозреваю, что на iPhone, у которых включены следующие настройки, у PWA есть проблемы с повторным поиском кеша: 1. Не разрешать кеш и 2. Ограниченный iphone (родительский контроль). После того, как я разрешил кешу работать, он все еще не работал. Работа. Я не мог отключить ограниченный режим, потому что владелец больше не знает код.
Я понял, что, разместив сайт через xampp и посетив его со своего телефона (iOS 12.1.1), я могу посещать его в автономном режиме. При обслуживании на моем сервере с nginx я также получаю ту же ошибку, о которой вы говорили. У меня пока нет решения, но, возможно, эта информация может вам помочь.
Вы когда-нибудь находили решение этой проблемы или в чем была проблема? Я несколько дней застревал с этой ошибкой и не нашел решения, с чего начать поиск.
Извините, до сих пор решение этой проблемы не найдено. Это случилось только на одном устройстве, поэтому я решил продолжить. Если хотите, можете попробовать перезагрузить iphone. До сих пор я предполагаю, что это сбой в конфигурации конфиденциальности в телефоне.
Источник
Ответ Service Worker FechtEvent.respondWith является нулевым на iOS 12.1 Safari
Я могу загрузить веб-сайт с помощью службы Worker на Android Chrome, macOS Chrome, а также Safari и на Windows Chrome для автономного использования. Когда я пытаюсь загрузить веб-сайт в iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, выхожу в автономный режим и снова открываю Safari, я получаю следующее сообщение об ошибке:
Safari can’t open the Site.
Ошибка: «FetchEvent.respondWith получил ошибку: TypeError: There похоже, нет соединения с Интернетом.»
FetchEvent.respondWith получил ошибку: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, я вряд ли смогу что-то сообщить о проблеме, потому что я ее не понимаю и надеюсь на знающих людей 🙂
Извините, что у меня пока нет ответа, но у меня точно такая же проблема с моим веб-приложением, и я потратил на нее несколько часов. Поэтому я хотел бы опубликовать здесь все свои выводы.
Шаги для проверки возможности работы веб-приложения в автономном режиме в iOS 12
зайдите на веб-сайт в Safari (iOS 12 или 12.1)
закройте вкладку веб-сайта в Safari
нажмите кнопку «Домой» на iPhone, чтобы перевести Safari в фоновый режим
нажмите кнопку питания iPhone, чтобы выключить экран
нажмите кнопку питания iPhone еще раз, чтобы разбудить телефон
отключите все сетевые подключения в центре управления iPhone (как wifi, так и сотовую связь)
откройте Safari, снова зайдите на сайт -> он должен работать в автономном режиме.
iOS 12 против iOS 11.3
Похоже, что эта проблема появилась с iOS 12. Мое веб-приложение (https://viewsbyme.com) прекрасно работало в автономном режиме на iOS 11.3, в версии которой мобильный Safari впервые представил Service Worker, но получало отклики от iOS 12 и iOS 12.1 в автономном режиме:
Safari не может открыть страницу. Ошибка гласила: «FetchEvent.respondWith получил ошибку: TypeError: Интернет-соединение, похоже, находится в автономном режиме.».
Не уверен, что это связано с этим сообщением об ошибке (в нем говорится «RESOLVED FIXED», но на самом деле еще нет, если вы прокрутите страницу до самого низа):
Примеры работающих и неработающих веб-приложений
В качестве примеров эти 2 PWA могут работать в автономном режиме в iOS 12:
И эти 2 PWA не могут работать в автономном режиме в iOS 12 (но они прекрасно работают в Chrome на других платформах):
Это кажется простым делом — сравнить скрипты Service Worker между этими PWA и выяснить, что заставляет их работать, а что нет. Но я все еще не выяснил дельту.
Источник
Содержание
Question: Q: fetchevent
Helpful answers
Safari bug #1730
Comments
dijonkitchen commented Oct 23, 2018 •
jeffposnick commented Oct 23, 2018
dijonkitchen commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018 •
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
oliviertassinari commented Oct 24, 2018
oliviertassinari commented Nov 6, 2018 •
dijs commented Nov 14, 2018
jeffposnick commented Nov 19, 2018
Question: Q: fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Helpful answers
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Dec 1, 2018 2:17 AM
There’s more to the conversation
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
Nov 30, 2018 10:10 AM
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Browser & Platform: Safari 12 macOS High Sierra 10.13.6
Issue or Feature Request Description: Refreshing workbox PWAs (like https://material-ui.com) leads to this sometimes.
Confirmed that they work fine on Firefox, Chrome and private mode Safari.
I figured if I cleared the cache, it would help, but it doesn’t seem to kill the service workers. Workaround is to disable service workers in Developer mode and I can load the websites properly.
The text was updated successfully, but these errors were encountered:
I just testing things out on Safari 12 on the desktop, and was not able to reproduce after navigating around to a few pages controlled by the service worker on https://material-ui.com. So, if there are any concrete reproduction steps that you’ve been able to narrow down, I’d love to dig in deeper.
In the meantime, though, I’ve noticed that you’re using a v3.0.0 pre-release version of Workbox. Workbox is up to v3.6.3 now (and we’ve got v4 alphas out), so as a first step, could you try upgrading your copy of Workbox? There were a number of improvements made throughout the v3 releases, and I’d like to at least make sure that we’re starting from the latest codebase.
Thanks @jeffposnick, I don’t control the site, so I’ll cross-post there.
@jeffposnick did you also trying refreshing pages? This should be when the Service workers do their work using the cache instead of routing through the single-page app.
Yes, I’ve tried a few times now to go through full navigations as well as page reloads and trigger any failures in Safari 12. I’ve not had any luck.
(That’s not to say that there isn’t an issue; it’s just that odd bugs can crop up in browsers’ implementations of service workers that are hard to trigger.)
This is iOS 12 Safari bug.
(It isn’t fixed in 12.0.1)
As per the initial issue report, I was working under the assumption that this was being seen on the desktop (Safari 12 / macOS High Sierra 10.13.6).
@jeffposnick hmm.. yeah, indeed. Then it must be the same bug on macOS as well because the error line is the same as on iOS when this happens.
Yes, my error was on macOS Safari. For what it’s worth, I tried it out on another laptop that recently upgraded to macOS Mojave and Safari there was fine.
We gonna start by upgrading the version of workbox on material-ui side.
We have been upgrading the version of workbox from the beta to the latest version. It hasn’t gone smoothly, a lot of people were facing cache invalidation issues. This is something that happens quite often every time we release a new version. It takes time to propagate. The cache invalidation is an important limitation of the service workers.
I’m suspecting it’s because of the next service worker waiting for its activation. Maybe there is a way to force it? At the expense of an unexpected full page reload when the user tries to refresh the page or to navigate to a different page. I will explore this path: https://developers.google.com/web/tools/workbox/guides/advanced-recipes.
Our team recently found this issue as well. Is the solution to upgrade workbox?
Our team recently found this issue as well. Is the solution to upgrade workbox?
The material-ui site was using a very outdated Workbox v3 beta, so updating was a good idea in general.
More recent versions of Workbox have had better «cache miss» fallback logic to take into account the fact that items that should be precached aren’t necessarily going to be there (due to browser bugs, or other failure scenarios), so they are more robust about at least showing something from the network when this crops up, instead of just failing to load the cached response.
But in general, my understanding is that this underlying issue a bug in Safari and is outside of Workbox’s control, and which is being tracked by the Webkit bugs linked to above.
Источник
Содержание
Question: Q: fetchevent
Helpful answers
Safari bug #1730
Comments
dijonkitchen commented Oct 23, 2018 •
jeffposnick commented Oct 23, 2018
dijonkitchen commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018 •
jeffposnick commented Oct 24, 2018
NekR commented Oct 24, 2018
dijonkitchen commented Oct 24, 2018
oliviertassinari commented Oct 24, 2018
oliviertassinari commented Nov 6, 2018 •
dijs commented Nov 14, 2018
jeffposnick commented Nov 19, 2018
Question: Q: fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Helpful answers
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Dec 1, 2018 2:17 AM
There’s more to the conversation
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
Nov 30, 2018 10:10 AM
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Browser & Platform: Safari 12 macOS High Sierra 10.13.6
Issue or Feature Request Description: Refreshing workbox PWAs (like https://material-ui.com) leads to this sometimes.
Confirmed that they work fine on Firefox, Chrome and private mode Safari.
I figured if I cleared the cache, it would help, but it doesn’t seem to kill the service workers. Workaround is to disable service workers in Developer mode and I can load the websites properly.
The text was updated successfully, but these errors were encountered:
I just testing things out on Safari 12 on the desktop, and was not able to reproduce after navigating around to a few pages controlled by the service worker on https://material-ui.com. So, if there are any concrete reproduction steps that you’ve been able to narrow down, I’d love to dig in deeper.
In the meantime, though, I’ve noticed that you’re using a v3.0.0 pre-release version of Workbox. Workbox is up to v3.6.3 now (and we’ve got v4 alphas out), so as a first step, could you try upgrading your copy of Workbox? There were a number of improvements made throughout the v3 releases, and I’d like to at least make sure that we’re starting from the latest codebase.
Thanks @jeffposnick, I don’t control the site, so I’ll cross-post there.
@jeffposnick did you also trying refreshing pages? This should be when the Service workers do their work using the cache instead of routing through the single-page app.
Yes, I’ve tried a few times now to go through full navigations as well as page reloads and trigger any failures in Safari 12. I’ve not had any luck.
(That’s not to say that there isn’t an issue; it’s just that odd bugs can crop up in browsers’ implementations of service workers that are hard to trigger.)
This is iOS 12 Safari bug.
(It isn’t fixed in 12.0.1)
As per the initial issue report, I was working under the assumption that this was being seen on the desktop (Safari 12 / macOS High Sierra 10.13.6).
@jeffposnick hmm.. yeah, indeed. Then it must be the same bug on macOS as well because the error line is the same as on iOS when this happens.
Yes, my error was on macOS Safari. For what it’s worth, I tried it out on another laptop that recently upgraded to macOS Mojave and Safari there was fine.
We gonna start by upgrading the version of workbox on material-ui side.
We have been upgrading the version of workbox from the beta to the latest version. It hasn’t gone smoothly, a lot of people were facing cache invalidation issues. This is something that happens quite often every time we release a new version. It takes time to propagate. The cache invalidation is an important limitation of the service workers.
I’m suspecting it’s because of the next service worker waiting for its activation. Maybe there is a way to force it? At the expense of an unexpected full page reload when the user tries to refresh the page or to navigate to a different page. I will explore this path: https://developers.google.com/web/tools/workbox/guides/advanced-recipes.
Our team recently found this issue as well. Is the solution to upgrade workbox?
Our team recently found this issue as well. Is the solution to upgrade workbox?
The material-ui site was using a very outdated Workbox v3 beta, so updating was a good idea in general.
More recent versions of Workbox have had better «cache miss» fallback logic to take into account the fact that items that should be precached aren’t necessarily going to be there (due to browser bugs, or other failure scenarios), so they are more robust about at least showing something from the network when this crops up, instead of just failing to load the cached response.
But in general, my understanding is that this underlying issue a bug in Safari and is outside of Workbox’s control, and which is being tracked by the Webkit bugs linked to above.
Источник
fetchevent
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1)
Posted on Nov 30, 2018 8:57 AM
Similar questions
I don’t see any software that normally causes problems. The Safe Mode boot may have fixed the problem since you posted the site is okay. The Safe Mode will reset some caches, forces a directory check, and is a general reset.
Loading page content
Page content loaded
Try going to Safari/Preferences/Privacy/Website Data and delete the cookie(s) for the site. Quit/reopen Safari and test.
Go to Safari Preferences/Extensions and turn all extensions off. Quit/reopen Safari and test. If okay, turn the extensions on one by one until you figure out what extension is causing the problem.
Try another browser as a test.
Try setting up another admin user account to see if the same problem continues. Please post back on whether or not this worked. Also try the Safe Mode. Please post back on whether or not this worked.
If it works in the Safe Mode, try running this program when booted normally and then copy and paste the output in a reply. The program was created by Etresoft, a frequent contributor. Please use copy and paste as screen shots can be hard to read. Click “Share Report” button in the toolbar, select “Copy to Clipboard” and then paste into a reply. This will show what is running on your computer. No personal information is shown.
In the safe mode the site works perfect. Then restart and then Etre Check, see below. (But now the site is perfect . )
EtreCheck version: 5.0.9 (5A020)
Report generated: 2018-11-30 21:00:51
Download EtreCheck from https://etrecheck.com
Runtime: 1:57
Performance: Excellent
Problem: Other problem
Description:
FetchEvent.respondWith. received an error: Returned response is null. WebkitServiceWorker:0
Major Issues: None
Minor Issues:
These issues do not need immediate attention but they may indicate future problems.
Apps with heavy CPU usage — There have been numerous cases of apps with heavy CPU usage.
Heavy I/O usage — Your system is under heavy I/O use. This will reduce your performance.
Abnormal shutdown — Your machine shut down abnormally.
Limited drive access — More information may be available with Full Drive Access.
Hardware Information:
MacBook Pro (15-inch, 2016)
MacBook Pro Model: MacBookPro13,3
1 2,7 GHz Intel Core i7 (i7-6820HQ) CPU: 4-core
16 GB RAM — Not upgradeable
BANK 0/DIMM0 — 8 GB LPDDR3 2133 ok
BANK 1/DIMM0 — 8 GB LPDDR3 2133 ok
Battery: Health = Normal — Cycle count = 38
Video Information:
Intel HD Graphics 530 — VRAM: 1536 MB
Color LCD 3360 x 2100
AMD Radeon Pro 455 — VRAM: 2048 MB
Drives:
disk0 — APPLE SSD SM0512L 500.28 GB (Solid State — TRIM: Yes)
Internal PCI-Express 8.0 GT/s x4 NVM Express
disk0s1 — EFI [EFI] 315 MB
disk0s2 [APFS Container] 499.96 GB
disk1 [APFS Virtual drive] 499.96 GB (Shared by 4 volumes)
Dropbox.app (Dropbox, Inc. — installed 2018-11-29)
StartUpHelper (Spotify — installed 2018-07-17)
iTunesHelper.app (Apple — installed 2018-10-30)
Internet Plug-ins:
Silverlight: 5.1.50901.0 (installed 2018-09-30)
AdobeAAMDetect: 3.0.0.0 (installed 2018-06-14)
QuickTime Plugin: 7.7.3 (installed 2018-10-30)
Time Machine:
Time Machine information not available without Full Drive Access.
Performance:
System Load: 1.55 (1 min ago) 2.27 (5 min ago) 1.22 (15 min ago)
Nominal I/O speed: 10.06 MB/s
File system: 18.71 seconds
Write speed: 1959 MB/s
Read speed: 2677 MB/s
CPU Usage:
Type
Overall
Individual cores
System
1 %
4 %
0 %
2 %
0 %
2 %
0 %
1 %
0 %
User
2 %
5 %
0 %
3 %
0 %
3 %
0 %
1 %
0 %
Idle
97 %
90 %
100 %
94 %
100 %
96 %
100 %
98 %
100 %
Top Processes by CPU:
Process (count)
Source
CPU
Location
genatsdb
Apple
31.00 %
appstoreagent
Apple
16.20 %
WindowServer
Apple
7.92 %
EtreCheckPro
Etresoft, Inc.
5.58 %
cloudphotosd
Apple
4.58 %
Top Processes by Memory:
Process (count)
Source
RAM usage
Location
com.apple.WebKit.WebContent (9)
Apple
1.05 GB
EtreCheckPro
Etresoft, Inc.
593 MB
mdworker_shared (18)
Apple
509 MB
kernel_task
Apple
400 MB
Spotify Helper (3)
Spotify
301 MB
Top Processes by Network Use:
Process
Source
Input
Output
Location
Spotify
Spotify
11 MB
321 KB
biometrickitd
Apple
20 KB
167 KB
Dropbox
Dropbox, Inc.
93 KB
91 KB
com.apple.iCloudHelper
Apple
39 KB
8 KB
mDNSResponder
Apple
25 KB
20 KB
Virtual Memory Information:
Available RAM
10.01 GB
Free RAM
6.50 GB
Used RAM
5.99 GB
Cached files
3.51 GB
Swap Used
0 B
Software Installs (past 30 days):
Name
Version
Install Date
Microsoft Outlook for Mac
16.16.18111001
2018-11-14
Microsoft PowerPoint for Mac
16.16.18111001
2018-11-14
Microsoft OneNote for Mac
16.16.18111001
2018-11-14
Microsoft Excel for Mac
16.16.18111001
2018-11-14
Microsoft Word for Mac
16.16.18111001
2018-11-14
Microsoft AutoUpdate
4.5.18110402
2018-11-15
HueMenu
1.9.1
2018-11-17
Diagnostics Information (past 7 days):
2018-11-30 20:54:48 Last Shutdown Cause: 3 — Hard shutdown
Источник
Service Worker FechtEvent.respondWith response имеет значение null в Safari iOS 12.1
Я могу загрузить веб-сайт с помощью службы Worker в Android Chrome, macOS Chrome, а также в Safari и в Windows Chrome для автономного использования. Когда я пытаюсь загрузить сайт на iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, перехожу в автономный режим и снова открываю Safari, я получаю следующий сообщение об ошибке:
Error: «FetchEvent.respondWith received an error: TypeError: There seems to be no connection to the Internet.»
==== AND in the console ====
FetchEvent.respondWith received an error: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, почти ничего не могу сообщить о проблеме, потому что не понимаю и надеюсь на кого-нибудь знающих 🙂
Я протестировал сценарий на нескольких iPhone (12.0, 12.0.1 (16A404), а также 12.1 (16B92)), и на всех из них я мог загрузить веб-приложение и снова открыть его в автономном режиме. В настоящее время я подозреваю, что на iPhone, у которых включены следующие настройки, у PWA есть проблемы с повторным поиском кеша: 1. Не разрешать кеш и 2. Ограниченный iphone (родительский контроль). После того, как я разрешил кешу работать, он все еще не работал. Работа. Я не мог отключить ограниченный режим, потому что владелец больше не знает код.
Я понял, что, разместив сайт через xampp и посетив его со своего телефона (iOS 12.1.1), я могу посещать его в автономном режиме. При обслуживании на моем сервере с nginx я также получаю ту же ошибку, о которой вы говорили. У меня пока нет решения, но, возможно, эта информация может вам помочь.
Вы когда-нибудь находили решение этой проблемы или в чем была проблема? Я несколько дней застревал с этой ошибкой и не нашел решения, с чего начать поиск.
Извините, до сих пор решение этой проблемы не найдено. Это случилось только на одном устройстве, поэтому я решил продолжить. Если хотите, можете попробовать перезагрузить iphone. До сих пор я предполагаю, что это сбой в конфигурации конфиденциальности в телефоне.
Источник
Ответ Service Worker FechtEvent.respondWith является нулевым на iOS 12.1 Safari
Я могу загрузить веб-сайт с помощью службы Worker на Android Chrome, macOS Chrome, а также Safari и на Windows Chrome для автономного использования. Когда я пытаюсь загрузить веб-сайт в iOS 12.1 Safari, он сначала работает. Но когда я закрываю Safari, выхожу в автономный режим и снова открываю Safari, я получаю следующее сообщение об ошибке:
Safari can’t open the Site.
Ошибка: «FetchEvent.respondWith получил ошибку: TypeError: There похоже, нет соединения с Интернетом.»
FetchEvent.respondWith получил ошибку: Returned response is null
Ниже вы можете увидеть скрипты в текстовом виде. К сожалению, я вряд ли смогу что-то сообщить о проблеме, потому что я ее не понимаю и надеюсь на знающих людей 🙂
Извините, что у меня пока нет ответа, но у меня точно такая же проблема с моим веб-приложением, и я потратил на нее несколько часов. Поэтому я хотел бы опубликовать здесь все свои выводы.
Шаги для проверки возможности работы веб-приложения в автономном режиме в iOS 12
зайдите на веб-сайт в Safari (iOS 12 или 12.1)
закройте вкладку веб-сайта в Safari
нажмите кнопку «Домой» на iPhone, чтобы перевести Safari в фоновый режим
нажмите кнопку питания iPhone, чтобы выключить экран
нажмите кнопку питания iPhone еще раз, чтобы разбудить телефон
отключите все сетевые подключения в центре управления iPhone (как wifi, так и сотовую связь)
откройте Safari, снова зайдите на сайт -> он должен работать в автономном режиме.
iOS 12 против iOS 11.3
Похоже, что эта проблема появилась с iOS 12. Мое веб-приложение (https://viewsbyme.com) прекрасно работало в автономном режиме на iOS 11.3, в версии которой мобильный Safari впервые представил Service Worker, но получало отклики от iOS 12 и iOS 12.1 в автономном режиме:
Safari не может открыть страницу. Ошибка гласила: «FetchEvent.respondWith получил ошибку: TypeError: Интернет-соединение, похоже, находится в автономном режиме.».
Не уверен, что это связано с этим сообщением об ошибке (в нем говорится «RESOLVED FIXED», но на самом деле еще нет, если вы прокрутите страницу до самого низа):
Примеры работающих и неработающих веб-приложений
В качестве примеров эти 2 PWA могут работать в автономном режиме в iOS 12:
И эти 2 PWA не могут работать в автономном режиме в iOS 12 (но они прекрасно работают в Chrome на других платформах):
Это кажется простым делом — сравнить скрипты Service Worker между этими PWA и выяснить, что заставляет их работать, а что нет. Но я все еще не выяснил дельту.
Источник
I created a pwa site which is working totally fine in android devices both online and offline. But it is throwing error FetchEvent.respondWith received an error: Returned response is null when tried to load on IOS device with safari 13.0 if the mobile device is offline.