Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

How Do I Fix This Error?: Module build failed (from ./node_modules/babel-loader/lib/index.js):

Ask Question

I'm building a project using react and express. while trying to set up the environment I keep getting an Error. Being new to babel I decided to search the internet for solutions but nothing I have tried has worked for me. I tried uninstalling @babel/core & @babel/preset-env and reinstalling their updated versions & I tried restarting VS code. Right now I'm completely stuck. Some help would be appreciated.

The Error:

ERROR in ./src/app/index.jsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: Unknown option: .presents. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at throwUnknownError (C:\Users\Yanki XXIV\Desktop\pluralsight-project\node_modules\@babel\core\lib\config\validation\options.js:122:11)
    at C:\Users\Yanki XXIV\Desktop\pluralsight-project\node_modules\@babel\core\lib\config\validation\options.js:106:5
    at Array.forEach (<anonymous>)
    at validateNested (C:\Users\Yanki XXIV\Desktop\pluralsight-project\node_modules\@babel\core\lib\config\validation\options.js:82:21)
    at validate (C:\Users\Yanki XXIV\Desktop\pluralsight-project\node_modules\@babel\core\lib\config\validation\options.js:73:10)
    at C:\Users\Yanki XXIV\Desktop\pluralsight-project\node_modules\@babel\core\lib\config\config-chain.js:169:34
    at cachedFunction (C:\Users\Yanki XXIV\Desktop\pluralsight-project\node_modules\@babel\core\lib\config\caching.js:33:19)
sight-project\node_modules\@babel\core\lib\config\partial.js:82:18)
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app main[1]

package.json

"name": "pluralsight-project", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack", "dev": "webpack-dev-server --open" "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@babel/core": "^7.0.0", "@babel/node": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", "@babel/register": "^7.0.0", "babel-loader": "^8.0.2", "webpack": "^4.17.2", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.7" "dependencies": { "react": "^16.4.2", "react-dom": "^16.5.0", "react-redux": "^5.0.7", "redux": "^4.0.0"

The error Also talks about index.jsx, I have no idea why but here is the file, index.jsx:

import { store } from './store';
import React from 'react';
import ReactDOM from 'react-dom';
import { Main } from './components/Main'
ReactDOM.render(
    < Main />,
    document.getElementById("app")

bablrc:

"presents":[ ["@babel/present-env", { "targets": { "node":"current" "@babel/present-react" -_- You mean to tell me I've been stressing this long over a simple syntax error ? lol Your a God, It worked but now I have another error – Yuri Mckoy Sep 6, 2021 at 16:59 Module not found: Error: Can't resolve '../../server/defaultState' in 'C:\Users\Yanki XXIV\Desktop\pluralsight-project\src\app\store' @ ./src/app/store/index.js 2:0-57 3:58-70 @ ./src/app/index.jsx @ multi (webpack)-dev-server/client?localhost:8080 ./src/app – Yuri Mckoy Sep 6, 2021 at 16:59

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.