score:0
i think it's related to webpack version only. can you please update the webpack
, webpack-cli
and webpack-dev-server
with latest version and check it.
hope this will work for you!
score:0
in package.json use "dev":"webpack serve" instead of "webpack-dev-server"
score:0
don't play with the webpack module for a while you are learning because it is tricky to do this stuff.
i have the same problem that you listed before
// change your mode to development in package.json
// make everything in devdependencies
{
"name": "timer",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack",
"start": "webpack-dev-server"
},
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
},
"keywords": [],
"author": "",
"license": "isc",
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devdependencies": {
...
}
}
in your webpack.config
const path = require('path')
const htmlwebpackplugin = require('html-webpack-plugin')
module.exports = {
entry: './app/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index_bundle.js'
},
module: {
rules: [
{ test: /\.(js)$/, use: 'babel-loader' },
{ test: /\.css$/, use: [ 'style-loader', 'css-loader' ]}
]
},
mode: 'development',
plugins: [
new htmlwebpackplugin({
template: 'app/index.html'
})
]
}
this may work for you.
score:1
if you have the error for the issues described here: https://github.com/webpack/webpack-dev-server/issues/2029
i wrote a python script to fix the problem until it's patched.
you can just add the command to your package.json script after adding the file to your project (assuming you have python installed).
https://github.com/bigbizze/fixwebpackerror-cannot-find-module-webpack-cli-bin-config-yargs
score:1
try the following. its worked for me
"scripts": { "lint": "eslint ./", "build": "webpack", "dev": "webpack serve" },
score:1
i had the same problem, try npm install --save-dev webpack webpack-cli webpack-dev-server webpack-merge
score:2
in your package.json file just change "dev": "webpack-dev-server" to "dev": "webpack serve"
score:3
i had the same problem and it was because the webpack version was not stable i used the lower version and the problem was solved
npm install webpack@4.32.2 --save-dev
npm install webpack-cli@3.3.2 --save-dev
npm install webpack-dev-server@3.5.1 --save-dev
Source: stackoverflow.com
Related Query
- How to fix : Cannot find module 'webpack/bin/config-yargs'
- Webpack - extract-text-webpack-plugin Cannot find module
- Error: Cannot find module 'html-webpack-plugin' - Webpack (React)
- React: "react-scripts start" cannot find module webpack
- react-scripts start error (Cannot find module '../scripts/start') - how can i fix this?
- Cannot find module 'electron' in Electron + React + Webpack setup
- Webpack cannot find module
- Uncaught Error: Cannot find module "fs" when using webpack
- Mocha + Webpack + Typescript (React): Error cannot find module (typescript component)
- webpack config error of cannot resolve module
- Webpack cannot find keymirror module with Typescript import
- webpack error on build run. 'Error: Cannot find module '@webassemblyjs/ast''
- Webpack missing module error: Cannot find module "."
- Trying to use jest with create-react-app and typescript. Get error: Jest: Failed to parse the TypeScript config file... Cannot find module 'ts-node'
- How fix/ignore this console error "TS2307: Cannot find module '@components/common/ButtonBlock' or its corresponding type declarations."
- Including React as a webpack external results in cannot find module 'react'
- webpack can't find module if file named jsx
- Cannot find module '@babel/core'
- ERROR in Cannot find module 'babel-core'. using react.js, webpack, and express server
- How to fix error "Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)"
- How to fix this error : " Module not found :can't resolve popper.js "
- webpack-dev-server Cannot find module 'webpack'
- Cannot find module babel-preset-es2015
- React, Typescript - Cannot find module ... or its corresponding type declarations
- typescript: Cannot find module 'react'
- Cannot find module 'react-dom/client' from 'node_modules/@testing-library/react/dist/pure.js'
- Cannot find module 'sass'
- After $npm install, Getting Error: Cannot find module '../lib/utils/unsupported.js'
- Cannot find module 'caniuse-lite/dist/unpacker/agents' when running create react app
- Typescript cannot find module that was defined in "paths" setting
More Query from same tag
- Emotion: Using both a class and the "css" method in "className" prop
- React Redux filter actions (generic sorting example)
- How to load the same component again in React?
- What should I use instead of document.queryselector() when using React?
- How to get API results to screen?
- Chart js label issue in react js
- Can't get my form in React to work properly
- React Hooks must be called in a React function component or a custom React Hook function
- React Native - How to measure size of content in ScrollView?
- React/ES6 -> How to call an React component class method from another component?
- is it good to use following in react hooks or any alternative to update the UI
- How to mock a nested component import in react js and test using react testing library
- React Hooks: Rerender even though state didn't change
- react router preload data from multiple components with a single loader animation
- Module not found: Error: Can't resolve './App' from React 18 w/TypeScript
- Passing an object from one component to another using props
- Getting error bundle.js:39454 Uncaught TypeError: Cannot read property 'email' of undefined using MERN stack
- How to disable the selection of an item when the first letter of the option is pressed in the Select component?
- How to call an API after setting state successfully?
- Using React js to submit some text boxes to SQL database
- Why do I receive null when i pass this id?
- Dispatching `push` does not change route in React Redux Router
- Having issues reupdating the UI when submitting form that calls an endpoint in React
- How to keep options state after losing focus on async-select?
- How to update props of React Component rendered using ReactDOM.render()
- useEffect to show snackbar if message is not null, and how to use useState with that?
- Get Formik Validation Current Year and Up
- How do I apply a margin to a React component without modifying the component itself?
- Module not found: Error: Can't resolve 'querystring' in '/Users/apple/Documents/mern-instagram/instagram-clone/node_modules/react-instagram-embed/es'
- Correct setup of redux-persist v5 with react boilerplate