WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
9.98k stars 4.01k forks source link

gutenberg react version conflict #62914

Open tanvirSajib opened 5 days ago

tanvirSajib commented 5 days ago

Description

"@wordpress/scripts": "^24.0.0", this load react 17.x

when i want to insatll "npm install @wordpress/data --save", it's require react 18.x

if i update "@wordpress/scripts": "^24.0.0" to "@wordpress/scripts": "^28.2.0" , then my react verion is updated but problem is then my plugin didn't show any more.

and there is another two things show in my console 1 deprecated.min.js?ver=e1f84915c5e8ae38964c:2 select( 'core/edit-post' ).isEditorPanelOpened is deprecated since version 6.5. Please use select( 'core/editor' ).isEditorPanelOpened instead. 2 deprecated.min.js?ver=e1f84915c5e8ae38964c:2 Using custom components as toolbar controls is deprecated since version 5.6. Please use ToolbarItem, ToolbarButton or ToolbarDropdownMenu components instead. See: https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols

Step-by-step reproduction instructions

{ "name": "eazydocs-pro", "version": "0.1.0", "description": "Example block written with ESNext standard and JSX support – build step required.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", "main": "build/index.js", "prettier": "@wordpress/prettier-config", "stylelint": { "extends": "@wordpress/stylelint-config/scss" }, "scripts": { "build": "wp-scripts build", "format": "wp-scripts format", "lint:css": "wp-scripts lint-style", "lint:js": "wp-scripts lint-js", "packages-update": "wp-scripts packages-update", "plugin-zip": "wp-scripts plugin-zip", "start": "wp-scripts start" }, "devDependencies": { "@wordpress/eslint-plugin": "^13.0.0", "@wordpress/prettier-config": "^2.0.0", "@wordpress/scripts": "^24.0.0", "@wordpress/stylelint-config": "^21.0.0", "eslint-config-prettier": "^8.3.0" }, "dependencies": { "@wordpress/element": "^6.2.0" } }

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

tanvirSajib commented 5 days ago

Issue solved.

I solved this problem by updating "@wordpress/scripts": "^24.0.0", to "@wordpress/scripts": "^26.0.0",

previously I updated it to "@wordpress/scripts": "^28.0.0",

t-hamano commented 5 days ago

Hi @tanvirSajib,

The problem you are experiencing may be due to a change in @wordpress/scripts version 28.0. Please see the following article:

JSX in WordPress 6.6 – Make WordPress Core