taofed / react-web

A framework for building web apps with React Native compatible API.
Other
3.36k stars 448 forks source link

Why I got ERROR in Path must be a string. Received undefined #245

Closed colin3dmax closed 7 years ago

colin3dmax commented 7 years ago

npm install npm start

ERROR in Path must be a string. Received undefined webpack: Failed to compile.

How to fixed this problem

下载项目,npm install 安装好需要的依赖 用 npm start 启动,出现上面的报错信息,请问大家有遇到过的吗,怎么解决这个问题

colin3dmax commented 7 years ago

找到问题了,在webpack.config.js 中, new HtmlPlugin时需要指定 filename 否则会报上面的 path错误

//需要指定Html文件名称,否则会报错 new HtmlPlugin({ filename:'index.html', }),