-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module build failed (from ./node_modules/babel-loader/lib/index.js): #8599
Comments
Hey @palaklive! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
It'll work fine if downgrade the version
{
"name": "webpack-4-tutorial",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack --mode development",
"build": "webpack --mode production"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"webpack": "^4.17.1",
"webpack-cli": "^3.1.0"
}
} |
The issue might be because
|
Indeed, @RedHope is correct. This is tripping up a lot of people so I've filed #668 to try to improve the error message. If you wish to install Babel 6.x, you can do
but if you're starting a new project, Babel 7 makes much more sense, so you would ideally do
|
Yes, @loganfsmyth I want to start a new project. But, When try to run... I'll Install...
Which are not compatible with each other. In this case, what should I do? |
What makes you say they aren't compatible? Those should work well together. |
In the original report you were using |
We have renamed the Babel packages: they aren't |
Yup @nicolo-ribaudo Everythiing is fine now with: .babelrc{
"presets": [
"@babel/preset-env"
]
} |
May be it is late to comment, but I needed the below 2 things to solve the problem:
The babel libraries in package.json
The
|
I think half the issue is your docs for webpack install say: If you do that in a new project, it installs incompatible versions & you get this error. I resolved it (to work with ES2015 loader) by clearing everything out: deleting my
and then updating {
"presets": ["@babel/preset-env"]
} |
|
I was with the same issue and it works fine after I put the same name of the dependencies at the .babelrc. "devDependencies": { { |
It really worked ,Thank you !! |
This was my problem. I changed the names of the presets in |
solve
preset
hope it will fine |
I'm on a new project and I started from the babel-loader readme with the following.
Yet, I was getting the similar error as everyone else. I noticed @thandrade88 mention However, looking at my new
|
ERROR in ./src/index.js este error me dio al intentar instalar webpack con babel luego pude solucionarlo con los pasos que me pasaron arriba |
In your node modules core module is not available . If problems still continued, post your webpack-config.js,package.json and .babelrc files. |
Hi i tried your suggestion, but still face same issue: [./src/index.js] 1.34 KiB {main} [built] [failed] [1 error] ERROR in ./src/index.js |
What's your config? |
this work for me thanks @anuragrksharma |
I finally found the solution here https://medium.com/@binyamin/creating-a-node-express-webpack-app-with-dev-and-prod-builds-a4962ce51334 node: {
// Need this when working with express, otherwise the build fails
__dirname: false, // if you don't put this is, __dirname
__filename: false, // and __filename return blank or /
},
externals: [nodeExternals()], // Need this to avoid error when working with Express |
I still have the same issue: My babelrc is as follows: My webpack.config.js is as follows: `const path = require('path'); const APP_DIR = path.resolve(__dirname, './src'); const config = { target: 'web', context: path.join(__dirname, './src'), entry: { output: { devtool: 'cheap-module-eval-source-map', plugins: [ module: { optimization: { resolve: { module.exports = config;` Please help me if someone found a solution to this. I tried all the methods as mentioned above including deletion of complete nodemodules. But it resulted in no luck. |
Unfortunately even after have unistalled older babel version package and installed the one for babel 7, even manuall, I tried even deleting node_module but still getting : ERROR in ./index.js
This is my package.json: { my .babelrc: { I out of idea as I know what is the issue, conflict betweekn Babel 7 an previous but all solution I found around aren't working
|
I stopped having issues when I removed "es2015" preset from .babelrc. |
@saulwolfdev fix worked for me! |
Hi.. I'm also running into this issue.. package.json
.babelrc
ERROR in ./src/index.js Any additional tip? |
You are mixing Babel 6 ( |
@nicolo-ribaudo thanks for the tip.. I've uninstalled all the babel packages and install the new ones using this command:
And now the error is slightly different. My webbpack.config.js file:
Thanks. |
it work for me, thank you |
this is what is did: then solved my problem |
@khorramk, tried your solution but still having problem, 98% after emitting SizeLimitsPlugin ERROR Failed to compile with 1 errors 1:14:00 PM error in ./resources/assets/js/app.js Module build failed (from ./node_modules/babel-loader/lib/index.js): |
@palaklive
NPM Command Line:
|
@ghost this worked for me thanks a lot |
.babelsrc webpack.config const HtmlWebPackPlugin = require("html-webpack-plugin"); Issue with babel loader. can help to fix? |
I am facing the same problem and my babel is already updated but still show the same error- |
Thanks |
I'm getting these errors. Can anyone help? |
That solved the problem for me yarn add -D babel-loader @babel/core @babel/preset-react @babel/preset-env @babel/helper-call-delegate``` |
Thank you 😊 so much, this solution worked perfectly for me. |
@anuragrksharma THANK YOU! |
|
Thanks! worked for me |
Thanks!, Gracias |
is work for me npm install -D @babel/core @babel/preset-env babel-loader @babel/preset-react in .babelrc thank you for all |
Edits by @JLHwung
If you hit this issue via search engines, please refer to #8599 (comment).
Bug Report
Current Behavior
Recently I'm trying to setup babel with webpack. and I'm getting an error.
package.json
package.json
Expected behavior/code
Babel Configuration (.babelrc, package.json, cli command)
debug.log
Environment
Possible Solution
Additional context/Screenshots
I follow the same step in past and it was work fine.
The text was updated successfully, but these errors were encountered: