【发布时间】:2022-01-02 14:22:54
【问题描述】:
我正在使用 VSCode 和 Google Chrome 开发 React 应用程序。 每次我在 VSCode 上保存我的 React 应用程序中的更改时,它都会刷新 Chrome 页面,但奇怪的是它会在整个页面上添加一个覆盖 iframe,并且不再可以点击任何内容。这是添加的 iframe 的 html 代码:
<iframe style="position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; border: none; z-index: 2147483647;">
<html data-lt-installed="true">
<head></head>
<body>
<script type="text/javascript">[THE CONTENT OF THE SCRIPT IS SO LONG THAT I CANNOT COPY IT HERE!]</script>
</body>
</html>
</iframe>
此外,它在控制台中为我提供了来自 VM9623:2 的以下错误代码:
Uncaught ReferenceError: process is not defined
at Object.4043 (<anonymous>:2:13168)
at r (<anonymous>:2:306599)
at Object.8048 (<anonymous>:2:9496)
at r (<anonymous>:2:306599)
at Object.8641 (<anonymous>:2:1379)
at r (<anonymous>:2:306599)
at <anonymous>:2:315627
at <anonymous>:2:324225
at <anonymous>:2:324229
at HTMLIFrameElement.e.onload (index.js:1)
问题通过刷新页面得到解决,但令人沮丧的是每次我在 VSCode 上保存更改时,我都必须再次手动刷新页面!
【问题讨论】:
标签: google-chrome npm visual-studio-code create-react-app react-scripts