查阅官方文档或社区: 如果问题仍未解决,可以查阅webpack官方文档和webpack-dev-server官方文档,或者在Stack Overflow等社区搜索类似问题的解决方案。 按照这些步骤操作后,通常可以解决“webpack-dev-server cannot get /”的问题。如果问题依然存在,可能需要更详细地检查具体的配置或代码实现。
I am trying to run a Webpack Dev Server. I am using TypeScript. I receive the following error when I open my http://localhost:8080/ I receive the error: Cannot GET / Here is my webpack.config.js file: const path = require('path'); const webpack = require('webpack'); module....
问题描述:项目运行npm start 浏览器始终报cannot get / ,webpack打包过程没有任何问题。 webpack.config.js const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); let getHtmlConfig = function (nam...
照着视频走下来,安装配置好webpack-dev-server后npm run dev,页面显示 cannot get /,视频里运行正常,猜测是因为安装的版本不一样,网上说只要文档不在contentBase所指定的目录中,就只会显示cannot get;所以只要文档放在该目录下就能正常工作了 1 2 3 devServer:{ contentBase:'./src', } 加上后npm run dev报...
照着视频走下来,安装配置好webpack-dev-server后npm run dev,页面显示 cannot get /,视频里运行正常,猜测是因为安装的版本不一样,网上说只要文档不在contentBase所指定的目录中,就只会显示cannot get;所以只要文档放在该目录下就能正常工作了 devServer:{contentBase:'./src',} ...
webpack的webpack-dev-server可以在本地构建nodejs的express服务器进行本地测试,可以在改动代码后自行刷新页面。昨晚试了下但总是不成功,浏览器打开localhost只显示cannot get xxx。翻了好多帖子和github的issues,英明神武的我竟然花了整整一个晚上才弄明白,羞耻。
这个问题已解决,我的配置如下: devServer: { contentBase: path.join(__dirname, "dist"), compress: true, open: true, openPage: "webpack-dev-server", }, output: { path :path.resolve(__dirname, 'dist'), filename: 'js/[name].bundle.js', // publicPath:'../' }, 页面就可以显示了,...
Run:npm run dev Create any component (e.g.Contact.vue) Import it as usual and add the route (e.g./contact) Addmode: 'history' You won't be able to open the route by typing it in the address bar, you'll see:Cannot GET /contact ...
Page1和Page2有自己独立的路由使用的是react-router-dom, 本地开发调试时,我的想法是webpack-dev-server访问localhost/Page1 就进入Page1的index.html;访问localhost/Page2就进入Page2的index.html,实验到此还是成立的。 当我localhost/Page1/about时,还是可以切换的。 然鹅我刷新页面时,就:Cannot GET /Page1/ab...
npmERR!Orifthat isn't available,you cangettheir info via:npmERR!npm owner ls npmERR!Thereislikely additional logging output above.npmERR!Pleaseinclude the following file with any support request:npmERR!D:wabgnpm-debug.log 原因: Webpack与webpack-dev-server版本不兼容而导致编译出错。