Cannot get run build to work as its throwing an error on minifying a file

by Hawkzey   Last Updated August 01, 2020 14:26 PM

I am fairly new to the webpack side of things when it comes to dev and i have recently implemented Azure AD integration into my react app. and all worked fine.

I have added a require for azure graph api, i get the following error when i try to do a build.

Failed to minify the code from this file:


The import that is causing the the problem is:

  var graph = require("@microsoft/microsoft-graph-client");

I think it has something to do with me ejecting my app so that i could support scss, i have also noticed that my script section in package.js is diffrent to most peoples as it has now npm start etc could some one explain this?.

  "scripts": {
"start": "rimraf ./build && node scripts/start.js",
"build": "node scripts/build.js",
"test": "cross-env CI=true node scripts/test.js --env=jsdom",
"lint": "eslint ./src/"


if further information is needed please say so.

Related Questions

Ract build with env file from a command line

Updated June 18, 2020 21:26 PM

compress reactJS bundle.js

Updated April 15, 2019 12:26 PM