重启webpack-dev-server: 在进行了上述步骤之后,尝试重启webpack-dev-server。 查阅官方文档或社区: 如果问题仍未解决,可以查阅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....
安装webpack-dev-server后,用 npm 打包运行,打开后显示 'Cannot get /' : 需要在webpack.config.js的devServer中添加以下代码: 现在再次运行,可以打开了:
resolve(__dirname, 'dist'), compress: true, port: 9000, open: true, } }; package.json "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "watch": "webpack --watch", "start": "webpack-dev-server --open", "build": "webpack --env.production" },前端工程...
照着视频走下来,安装配置好webpack-dev-server后npm run dev,页面显示 cannot get /,视频里运行正常,猜测是因为安装的版本不一样,网上说只要文档不在contentBase所指定的目录中,就只会显示cannot get;所以只要文档放在该目录下就能正常工作了 devServer:{contentBase:'./src',} ...
照着视频走下来,安装配置好webpack-dev-server后npm run dev,页面显示 cannot get /,视频里运行正常,猜测是因为安装的版本不一样,网上说只要文档不在contentBase所指定的目录中,就只会显示cannot get;所以只要文档放在该目录下就能正常工作了 1 2 3
Version 3.0.1 Reproduction link https://codepen.io/anon/pen/XVzRJY Steps to reproduce Run default installation to create a new project: vue init webpack projectName The webpack.dev.conf.js has been updated in the last update and the rout...
这个问题已解决,我的配置如下: 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:'../' }, 页面就可以显示了,...
解决方法: 通过以下命令卸载并重新安装: 卸载版本: cnpm uninstall webpack -g cnpm uninstall -g webpack-dev-server 安装指定版本 cnpm install webpack@3.8.0 --save-dev cnpm install webpack-dev-server@2.9.7 --save -dev
There's a good chance this is user error, but I cannot get webpack-dev-server to update my bundles correctly. I've installed both webpack and webpack-dev-server globally using npm. I can bundle perfectly fine with the webpack command, bu...