Automattic / Automattic/isolated-block-editor

Builds only work when React is external

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
409
Forks
66
PR merge metrics
No merged PRs in 30d

Description

If you try and bundle React along with the editor and Gutenberg you get an error:

`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons`

It seems that this can be caused by multiple versions of React. I haven't tracked down where this could be happening.

Making React external solves the problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing a build that bundles React with the editor and Gutenberg instead of marking React external. Inspect the bundled dependency versions and the source of the invalid hook call. Done means the editor and Gutenberg build and run successfully with React bundled, without the hook error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.