Running webpack gives the following error:
The reason for the bug is:
The environment variable is not configured properly. Although the mode: ‘development’ configuration item is configured in webpack.dev.js, this environment variable is the environment variable for code running, not the environment variable for babel running, so it needs to be defined.
solution:
// Download cross-env. A library dedicated to defining environment variables npm install --save-dev cross- env // Add the configuration in front of the webpage running command in package.json "scripts" : { "start": "npm run dev" , "dev": " cross-env NODE_ENV=development webpack serve --config ./config /webpack.dev.js" },
Read More:
- [Solved] webpack.config.js configuration encountered Error: Cannot find module’@babel/core’&&Cannot find module’@babel/plugin-transform-react-jsx’
- React-native Error: Make sure you have the Android development environment set up [Solved]
- Vue require Error: node_modules/babel-loader/lib
- Some problems encountered in the initial construction of Ant Design Pro project, such as cross Env, webpack and so on
- [Solved] npm Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
- Error: env [NODE_ENV] is not set (How to Solve)
- [Solved] An error occurred while processing your request…enable the Development environment by setting …
- [Solved] Opencv Compile Error: (CMake Error: The following variables are used in this project, but they are set to not)
- [Solved] There are test failures. Please refer to D:\Java_study\springboot\springboot-sugon-3\target\surefire-reports for the individual test results.
- [PX4 Bug] make px4_sitl gazebo Error: CMake Error: The following variables are used in this project
- Execute an error under pytest cmd make sure your test modules/packages have valid Python names.
- [Solved] Error downloading standard development IDs for MRPC. You will need to manually split your data.
- [Solved] react18 swiper Error: Cannot read properties of undefined (reading ‘wrapperClass’)
- Mavenzai install Error: There are test failures
- React Hook “useState“ is called in function “xxx“ which is neither a React function component or
- The page you are requesting cannot be served because of the extension configuration
- [Solved] TFrecords Create Datas Error: Number of int64 values != expected. Values size: 1 but output shape: [3]
- [Solved] Wepy build watch Error: ERR! Parse WePY config failed. Are you trying to use
- Git Error: please tell me who you are [How to Solve]