Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix @babel/plugin-proposal-private-property-in-object errors #819

Open
harsh183 opened this issue Jun 8, 2024 · 1 comment
Open

Fix @babel/plugin-proposal-private-property-in-object errors #819

harsh183 opened this issue Jun 8, 2024 · 1 comment

Comments

@harsh183
Copy link
Member

harsh183 commented Jun 8, 2024

Looks like @babel/plugin-proposal-private-property-in-object is deprecated and to be replaced with @babel/plugin-transform-private-property-in-object.

Honestly I'm not sure how much we use it, so I'd be glad to not have this warning every time, but I haven't looked into it. Here's what warning we get when running a build:

Creating an optimized production build...
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.

Adding it in dev dependencies didn't make the warnings go away, maybe migrating over or removing this somehow might be the move.

Relevant links:

https://babeljs.io/docs/babel-plugin-transform-private-property-in-object

https://stackoverflow.com/questions/76435306/babel-preset-react-app-is-importing-the-babel-plugin-proposal-private-propert

@harsh183
Copy link
Member Author

harsh183 commented Jun 9, 2024

Figured out what unrelated reasons probably is after running grep on node_modules

./@babel/preset-env/package.json: "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2",

When I run head

{
  "name": "@babel/preset-env",
  "version": "7.24.5",
  "description": "A Babel preset for each environment.",
  "author": "The Babel Team (https://babel.dev/team)",
  "homepage": "https://babel.dev/docs/en/next/babel-preset-env",
  "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20preset-env%22+is%3Aopen",
  "license": "MIT",

Looks like the latest code on github still has this too, so it's a safe warning to ignore. React Scripts will maybe fix it one day (fix in Github facebook/create-react-app@0f5e990), but doesn't look like they're going to release it any time soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant