react-web
react-web copied to clipboard
运行react-web start时报错: ERROR in Path must be a string.
如题,按照文档安装了CLI,并初始化项目之后,运行react-web start时报错: ERROR in Path must be a string. Received undefined webpack: Failed to compile.
有没有谁遇到过这个问题啊?怎么解决呢?
你应该进入项目后,再运行 react-web start
我也遇到了相同的问题,请问是怎么解决的?
把操作的具体步骤描述下
把 NodeJS 版本 切换为 5.x
webpack config中outPut添加一个'publicPath': output: { publicPath: '..', ... }
@cherishyan 按照你所说的配置了webpack,不再报ERROR in Path must be a string. Received undefined的错误编译也通过了,但是打开网页的时候"Cannot Get /",项目是本身是空的react-native初始页面,配置大致是:[email protected]、react-native@^0.38.1、react-dom@^15.3.2、[email protected],有人在类似的版本配置中可以正常运行吗?
@ronankim
add a key 'publicPath' to the webpack config output node
output:{ publicPath:'' }
把node版本降低到5.X就解决了
@cherishyan 按照你所说的配置了webpack,不再报ERROR in Path must be a string. Received undefined的错误编译也通过了,但是打开网页的时候"Cannot Get /",项目是本身是空的react-native初始页面,配置大致是:[email protected]、react-native@^0.38.1、react-dom@^15.3.2、[email protected],有人在类似的版本配置中可以正常运行吗?
publicPath的值别用 '..', 用空串 ''就行, "Cannot Get /"这是启动的web服务索引打包的路径不对