Service Worker registration error: Unsupported MIME type ('text/html')

前端 未结 12 1290
梦如初夏
梦如初夏 2020-12-05 17:44

I\'m using create-react-app with an express server.

create-react-app has a pre-configured ServiceWorker that caches local assets (https://github.com/fac

12条回答
  •  再見小時候
    2020-12-05 18:07

    I use nginx to serve react app and I resolved this issue adding mime types to nginx:

    http {
        include    mime.types; // <--- this line
    
        # another config details
    }
    

    Also you can find mime.types file here

提交回复
热议问题