我正在通过热模块重新加载 - 开发服务器获得CORS问题.我在端口上使用dev-server 3000但是应用程序是从另一个端口提供的http://localhost:52024/.
这是我得到的错误(Chrome,Windows 10):
GET http://localhost:3000//sockjs-node/info?t=1502216500095 404 (Not Found)
XMLHttpRequest cannot load http://localhost:3000//sockjs-node/info?t=1502216500095. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:52024' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
[WDS] Disconnected!
Run Code Online (Sandbox Code Playgroud)
实际上我遇到两个错误:第一个是由//路径中的双斜线引起的,另一个是与CORS相关的错误.这是我的webpack.config.js:
const webpack = require('webpack'),
path = require('path');
module.exports = {
entry: …Run Code Online (Sandbox Code Playgroud) javascript cors webpack webpack-dev-server hot-module-replacement
我正在使用 expo 在 Windows 10 上开发一个 React Native 应用程序。
当我运行时,expo start仅当与互联网断开连接并使用--offline交换机时,Metro Builder 才会自动启动。连接后--offline开关就没用了。
这是控制台输出,没有错误或警告(对于 也是如此expo start --offline):
expo start
Starting project at C:\Users\xxx\Projects\my-reactnative-project
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
Run Code Online (Sandbox Code Playgroud)
没有二维码,没有链接,按或Tunnel没有任何区别。LANLocal
我尝试重新安装expo-cli但问题仍然存在。这是以下的输出expo diagnostics:
Expo CLI 3.13.5 environment info:
System:
OS: Windows 10 10.0.18363
Binaries:
Node: 12.11.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD …Run Code Online (Sandbox Code Playgroud)