[Solved] Webpack webpack-dev-server Page Error: cannot get/

Follow the video and go down. After the webpack dev server is installed and configured, NPM run dev is displayed on the page   Cannot get /. The video runs normally. I guess it is because the installed versions are different. The Internet says that as long as the document is not in the directory specified by contentbase, only cannot get will be displayed; So as long as the document is placed in this directory, it can work normally


In addition, NPM run dev reports an error, saying that there is no such attribute in devserver. It should be the version problem. Finally, it is found in the official website document

devServer: {
        static: './src',

After re running NPM run dev, the page displays normally and functions normally.

Similar Posts: