15

I upgraded to the react-scripts v5 and my build fails with an unuseful message:

Creating an optimized production build...
Failed to compile.

Module not found: Error: Can't resolve '...' in '/project/src'

As you can see it only tells me that there was a problem in the src directory, which is literally the entire project.

How can I increase verbosity of this script?

Hossein Fallah
  • 1,859
  • 2
  • 18
  • 44

1 Answers1

-3

Do you have the index.js file inside project/src? Does it have import from ... (or /project/index.js)?

kamtugeza
  • 1
  • 2
  • 1
    I do have `index.js` inside `src` directory. But it does not import `...` from anywhere. Also my code works just fine with `npm run start`. It only fails for `npm run build`. – Hossein Fallah Dec 20 '21 at 15:00