Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module build failed: Error: Couldn't find preset "stage-0" relative to directory

I am getting the following error but only when I try to use the following dependency, otherwise it works fine.

Error:

Module build failed: Error: Couldn't find preset "stage-0" relative to directory

Import causing the issue

import {ActionDone} from "material-ui"

It is part of the react-material-icons npm package. If I remove that import and uses of it everything works fine. What am I missing?

like image 437
greyfox Avatar asked Jan 22 '26 12:01

greyfox


2 Answers

You only need to install babel-preset-stage-0:

Command for this:

npm install --save-dev babel-preset-stage-0

like image 51
Mansi Teharia Avatar answered Jan 24 '26 02:01

Mansi Teharia


Try installing the stage 0 preset.

Refer to this article: https://babeljs.io/docs/plugins/preset-stage-0/

like image 43
Sanjit Roy Avatar answered Jan 24 '26 01:01

Sanjit Roy