问题描述
我正在使用Expo SDK Version: 36生成PWA。
-
curl http://$LOCAL_IP:19006/expo-service-worker.js
:确定200 -
curl http://localhost:19006/expo-service-worker.js
:失败=> 不提供服务expo-service-worker.js
它提供静态资产index.html
。
它在控制台中导致以下错误:
Failed to register service-worker DOMException: Failed to register a ServiceWorker for scope ('http://localhost:19006/') with script ('http://localhost:19006/expo-service-worker.js'): The script has an unsupported MIME type ('text/html').
文件expo-service-worker.js
未被投放,这在必须实施Web推送通知时会出现问题,因为当站点未提供localhost
时,只有HTTPS
在没有文件推送的情况下可以工作。
相关问题:
我该如何解决?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)