Answer the question
In order to leave comments, you need to log in
Unexpected token < in JSON error in ngsw?
Created a progressive web application. On localhost it works like a Swiss watch - it caches files, remembers requests, and installs the application manifest. But when on the server - Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0.
The Service-Worker registers, but the cache storage is empty.
Server with HTTPS, Apache-Tomcat-9.
My ngsw-config
{
"index": "/inspector/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/inspector/favicon.ico",
"
"/inspector/*.js",
"/inspector/*.json",
"/inspector/manifest.json",
"/inspector/assets/html/iframe.html",
"!/inspector/*-es5*. js"
],
"urls": [
" https://fonts.googleapis.com/** ",
" https://fonts.gstatic.com/s/** "
]
}
},
{
"name": " assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/inspector/assets/**",
"/inspector/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question