We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea15eba commit e783bf8Copy full SHA for e783bf8
packages/react-scripts/template/src/serviceWorker.js
@@ -68,7 +68,7 @@ function registerValidSW(swUrl, config) {
68
console.log('New content is available; please refresh.');
69
70
// Execute callback
71
- if (config.onUpdate) {
+ if (config && config.onUpdate) {
72
config.onUpdate(registration);
73
}
74
} else {
@@ -78,7 +78,7 @@ function registerValidSW(swUrl, config) {
78
console.log('Content is cached for offline use.');
79
80
81
- if (config.onSuccess) {
+ if (config && config.onSuccess) {
82
config.onSuccess(registration);
83
84
0 commit comments