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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.22.5 inproduced Breaking Changes for Preset Env #15694

Closed
1 task
daniluk4000 opened this issue Jun 9, 2023 · 6 comments
Closed
1 task

v7.22.5 inproduced Breaking Changes for Preset Env #15694

daniluk4000 opened this issue Jun 9, 2023 · 6 comments
Labels
i: enhancement i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@daniluk4000
Copy link

馃捇

  • Would you like to work on this feature?

What problem are you trying to solve?

When I use @babel/plugin-proposal-private-property-in-object after update to v7.22.5 I'll HAVE to add it to devDependencies even if it's required by dependencies of some plugin.

This is a breaking changes for presets like @nuxt/babel-preset-app (FYI @danielroe @pi0 this broke Nuxt 2 clear install).

Full error:

Error: [BABEL] /WebstormProjects/unsubscribe/frontend/.nuxt/client.js: --- PLACEHOLDER PACKAGE --- This @babel/plugin-proposal-private-property-in-object version is not meant to be imported. Something is importing @babel/plugin-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.

Describe the solution you'd like

This had to be at least mentioned in release logs. Also it could be a deprecation warning

Describe alternatives you've considered

Don't break existing setups in minor versions, the same thing as #15679 suggested.

Documentation, Adoption, Migration Strategy

No response

@babel-bot
Copy link
Collaborator

Hey @daniluk4000! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@danielroe
Copy link

Fix is in progress at nuxt/nuxt#21488

@daniluk4000
Copy link
Author

daniluk4000 commented Jun 9, 2023

Fix is in progress at nuxt/nuxt#21488

Great! Didn't notice that, sorry for ping.

Btw, we've tried same solution in our internal library - didn't work. I had to add this to devDependencies, otherwise it refused to work. That's exactly why this is a breaking change - at least for now I didn't find solution to fix this on library side.

@nicolo-ribaudo
Copy link
Member

That's exactly why this is a breaking change

That's why we released @babel/plugin-proposal-private-property-in-object as a pre-release version: because it had a breaking change, and releasing it as a "normal" version would have been a semver violation.

Even if we had released it as 8.0.0, this problem would have not being solved because nuxt didn't specify anywhere that it wanted a version compatible with ^7.0.0 (so it would have automatically received v8.0.0).

@daniluk4000
Copy link
Author

daniluk4000 commented Jun 9, 2023

That's exactly why this is a breaking change

That's why we released @babel/plugin-proposal-private-property-in-object as a pre-release version: because it had a breaking change, and releasing it as a "normal" version would have been a semver violation.

But if preset-env requires it, it automatically becomes the default when running with clear lockfile.

If it is simply added to any library, in lockfile you will see two versions

image

When I call require it imports 7.21.0-placeholder-for-preset-env.2 but not 7.21.11 :(

Even if we had released it as 8.0.0, this problem would have not being solved because nuxt didn't specify anywhere that it wanted a version compatible with ^7.0.0

Babel Preset env would require ^7.22.5 (or smth like that) like it did before (and does now with every package but this one) and it would never receive V8.

@daniluk4000
Copy link
Author

I'm closing this as Nuxt fixed the issue, but I still think this had to be mentioned in changelog with upgrade steps/advices.

@daniluk4000 daniluk4000 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2023
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: enhancement i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

4 participants