[React]babel-preset-react-app 경고

진서형·2025년 1월 25일

❗ 문제

프로젝트 실행 시 해당 경고 발생

One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.

babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.

📍 인식

babel-preset-react-app 패키지가 @babel/plugin-proposal-private-property-in-object라는 의존성을 사용하고 있으나, 이를 명시적으로 선언하지 않았다는 내용의 오류이다.
현재는 다른 의존성 대문에 node_modules 폴더에 해당 패키지가 있어 동작하지만, 언제든 이상이 생길 수 있으니 누락된 의존성을 직접 추가해야한다.

✅ 해결

# @babel/plugin-proposal-private-property-in-object가 devDependencies에 추가
npm install --save-dev @babel/plugin-proposal-private-property-in-object

0개의 댓글