0

NPM 8.6.0 NODE 18

running npm run start

Will get the webpage up and running however will not recompile the components..

Main.js reads as

import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { createStore } from 'redux';

import App from './components/app';
import reducer from './reducers';

let store = createStore(reducer);

render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('root')
);



WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/

ERROR in ./app/Main.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/herbstzu/Desktop/REPOS/MIT_WEBS/tripsharing/node_modules/babel-preset-react/lib/index.js
    at createDescriptor (/Users/xxx/Desktop/REPOS/_WEBS/tripsharing/node_modules/@babel/core/lib/config/config-descriptors.js:211:11)
    at createDescriptor.next (<anonymous>)
    at step (/Users/xxx/Desktop/REPOS/_WEBS/tripsharing/node_modules/gensync/index.js:261:32)
    at /Users/xxx/Desktop/REPOS/_WEBS/tripsharing/node_modules/gensync/index.js:273:13
    at async.call.result.err.err (/Users/xxx/Desktop/REPOS/_WEBS/tripsharing/node_modules/gensync/index.js:223:11)

webpack 5.73.0 compiled with 1 error and 1 warning in 6873 ms
dependencies": {
    "csv": "^6.2.0",
    "d3": "^7.6.1",
    "gsap": "^3.10.4",
    "immutable": "4.1.0",
    "jquery": "^3.6.0",
    "json-loader": "0.5.7",
    "lodash": "4.17.21",
    "rc-slider": "^10.0.0",
    "react": "16.14.0",
    "react-dom": "16.14.0",
    "react-motion": "0.5.2",
    "react-redux": "8.0.2",
    "react-retina-image": "^2.0.5",
    "redux": "^4.2.0",
    "stats-webpack-plugin": "^0.7.0",
    "textures": "^1.2.3",
    "turf": "3.0.5"
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-loader": "8.2.5",
    "babel-preset-es2015": "6.6.0",
    "babel-preset-react": "6.24.1",
    "babel-preset-stage-2": "6.24.1",
    "grunt": "^1.5.3",
    "grunt-contrib-concat": "~2.1.0",
    "grunt-contrib-nodeunit": "^4.0.0",
    "grunt-contrib-sass": "~2.0.0",
    "grunt-contrib-watch": "^1.1.0",
    "webpack": "^5.73.0",
    "webpack-cli": "^4.10.0",
    "webpack-dev-server": "^4.9.3"
  }
BostonMacOSX
  • 1,369
  • 2
  • 17
  • 38
  • Please check your babel config. Probably `.babelrc`. Maybe try solutions given here https://stackoverflow.com/questions/58667330/got-error-plugin-preset-files-are-not-allowed-to-export-objects-only-functions – Irfanullah Jan Aug 05 '22 at 01:18
  • @IrfanullahJan interestingly there is no .bablerc in the root of the app – BostonMacOSX Aug 05 '22 at 12:12

0 Answers0