React应用程序编译成功,当我打开它时 localhost 没有问题。但当我用ip打开它时,我遇到了错误。
localhost
以下是成功编译的反应:
当我用打开应用程序时出错 http://192.168.1.101:300
http://192.168.1.101:300
看起来chrome试试看 https 而不是 http .
https
http
我尝试使用其他端口,但遇到了同样的问题。
更新
我也注意到了这一点:
我只是删除 <meta http-equiv="Content-Security-Policy" content="default-src 'self'"> 从 head 在html中。问题解决了。
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
head