【发布时间】:2021-10-18 01:20:48
【问题描述】:
因为我正在学习 freecodecamp 上的编码教程,所以我第一次接触到 Mac 的 Visual Studio Code 编码和使用。我安装了 VSC 和 live server 和 Chrome 浏览器扩展,但是当我去 live server 时出现错误:
// = 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf()); } parent.appendChild(elem); } } var 协议 = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var 地址 = 协议 + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(地址); socket.onmessage = function (msg) { if (msg.data == 'reload') window.location.reload();否则 if (msg.data == 'refreshcss') refreshCSS(); }; if (sessionStorage && !sessionStorage.getItem('IsThisFirstTime_Log_From_LiveServer')) { console.log('Live reload enabled.'); sessionStorage.setItem('IsThisFirstTime_Log_From_LiveServer', true); } })(); } else { console.error('升级您的浏览器。此浏览器不支持 WebSocket 进行实时重载。'); } // ]]>
我在 Mozilla 上尝试过,但扩展程序甚至无法安装为插件损坏 - https://share.getcloudapp.com/WnuG42w2
在 Firefox 上尝试不使用扩展程序并得到与 Chrome 相同的错误。
任何帮助将不胜感激!
【问题讨论】: