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

Babel Error: @babel/plugin-proposal-private-property-in-object explicit dependency #209

Closed
j3tan opened this issue Jun 15, 2023 · 5 comments

Comments

@j3tan
Copy link

j3tan commented Jun 15, 2023

Hitting a newly introduced error message in babel version 7.22.5 causes the following error:

--- PLACEHOLDER PACKAGE ---
This @babel/plugin-proposal-private-property-in-object version is not meant to
be imported. Something is importing
@babel/plugi-proposal-private-property-in-object without declaring it in its
dependencies (or devDependencies) in the package.json file.
Add "@babel/plugin-proposal-private-property-in-object" to your devDependencies
to work around this error. This will make this message go away.

Since packemon uses @babel/plugin-proposal-private-property-in-object for babel config, it needs to explicitly declare it as a dependency.

[resolveFromBabel('@babel/plugin-transform-private-property-in-object'), { loose: true }],

Related:
https://github.com/babel/babel-plugin-proposal-private-property-in-object
babel/babel#15687
babel/babel#15694

@milesj
Copy link
Owner

milesj commented Jun 16, 2023

@j3tan This is a weird one. I'm not importing @babel/plugin-proposal-private-property-in-object anywhere.

But I am importing @babel/plugin-transform-private-property-in-object which is different (note transform vs proposal). There were renamed in 7.22: https://babeljs.io/blog/2023/05/26/7.22.0#renamed-packages

Maybe node modules in a weird state? Does deduping fix it?

I'll dig a bit deeper anyways.

@milesj
Copy link
Owner

milesj commented Jun 16, 2023

I can't seem to reproduce this. Is it just being logged to the console during a build?

@j3tan
Copy link
Author

j3tan commented Jun 16, 2023

@milesj My bad, this may be due to using an older version of packemon . I had not realized you moved away from the proposal package 2 weeks ago and we definitely haven't bumped since before that.

I'll verify and close if that is the case

@j3tan
Copy link
Author

j3tan commented Jun 16, 2023

Some repos are still using packemon@2.x so we're using yarn resolutions to bypass the warning for now.

@milesj
Copy link
Owner

milesj commented Jun 16, 2023

Yea this was fixed in 3.1.1. I'll leave this open for now in case there's more issues around it.

@j3tan j3tan closed this as completed Jun 20, 2023
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

2 participants