Open Mezzle opened 2 years ago
Thanks @Mezzle for reporting, we likely need to add @babel/plugin-proposal-private-property-in-object
in the babel-preset-react-app
package as a dependency in package.json
+1
Thanks! #11751 is added to 5.0.1 milestone
Is there a temporary fix for this, it seems I cannot use CRA with yarn workspaces currently
Add to your .yarnrc.yml:
packageExtensions:
babel-preset-react-app@*:
dependencies:
"@babel/plugin-proposal-private-property-in-object": "*"
In addition to what @llimos said, you also need to run yarn install
afterwards to update your yarn.lock
file with this change.
why not just "yarn add @babel/plugin-proposal-private-property-in-object" ?
why not just "yarn add @babel/plugin-proposal-private-property-in-object" ?
Because that doesn't resolve the warning. That adds it to your package.json, which - as the error states - makes the import ambiguous and unsound.
Added this to my .yarnrc.yml
file
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.1.1.cjs
Seems to have resolved it
This issue seems to be solved for us after upgrading create-react-app to 5.0.1 (and yarn to 3.3.1).
We have previously used solution provided by Ilimos (https://github.com/facebook/create-react-app/issues/11793#issuecomment-998230832). Now yarn start & yarn build works for us with that workaround removed from .yarnrc.yml.
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 maintained anymore. It is thus unlikely that this bug will ever be fixed. If you are starting a new project, you may consider using maintained alternatives such as Vite (https://vitejs.dev/) instead.
Add "@babel/plugin-proposal-private-property-in-object" to your devDependencies to work around this error. This will make this message go away.
How to resolve it
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 maintained anymore. It is thus unlikely that this bug will ever be fixed. If you are starting a new project, you may consider using maintained alternatives such as Vite (https://vitejs.dev/) instead.
Add "@babel/plugin-proposal-private-property-in-object" to your devDependencies to work around this error. This will make this message go away.
How to resolve it
Hi. How is that CRA is not maintained anymore? You are writing in CRA issues list :-D Isn't this just some advertisement of the Vite project? :D
Thanks
On Mon, Jun 5, 2023 at 9:34 PM trohr @.***> wrote:
One of your dependencies, babel-preset-react-app, is importing the @./plugin-proposal-private-property-in-object" package without declaring it in its dependencies. This is currently working because @./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 maintained anymore. It is thus unlikely that this bug will ever be fixed. If you are starting a new project, you may consider using maintained alternatives such as Vite (https://vitejs.dev/) instead.
Add @.***/plugin-proposal-private-property-in-object" to your devDependencies to work around this error. This will make this message go away.
How to resolve it
Hi. How is that CRA is not maintained anymore? You are writing in CRA issues list :-D Isn't this just some advertisement of the Vite project? :D
— Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/11793#issuecomment-1577076112, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUL3RSRQL3EWOVPEIVFFQZTXJX7RHANCNFSM5KJPM6WQ . You are receiving this because you commented.Message ID: @.***>
NGATTFPVV
Describe the bug
When attempting to use create-react-app with yarn 3, running the scripts returns the following error
Did you try recovering your dependencies?
3.1.1
Which terms did you search for in User Guide?
N/A
Environment
Steps to reproduce
Expected behavior
App would start
Actual behavior
Multitude of errors, including the above regarding issue with dependency (others are resolvable by adding the dependencies manually)
Reproducible demo
https://github.com/Mezzle/cra-yarn-bug-example