it is text/html is it possible to serve it as application/javascript ??
Yes, add response header in nginix config.
you mean to say like this: location /staticfiles { root /var/www/myapp_frontend; location ~* \.(js)$ { add_header Content-Type text/javascript; } } right?
I did that but still getting this error in console: DOMException: Failed to register a ServiceWorker for scope ('https://teststore.myshopify.com/apps/myapp/') with script ('https://teststore.myshopify.com/apps/myapp/sw.js'): The script has an unsupported MIME type ('text/html').
I think may be that error is due to favicon which also getting loaded when I refresh page which is loading js file can that happen because of favicon? which is of text/html? How to disable that favicon in nginx? I don;t understand why is that favicon loading when I am just loading static JS file?
Could he cache maybe?
https://www.nginx.com/resources/wiki/start/topics/examples/full/
Обсуждают сегодня