GrapesJS / GrapesJS/react

[ERROR] Could not resolve "react" / "react-dom"

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
183
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Doesn't seem to work with Remix, get the following errors. I've tried a number of workarounds with no prevail. Any suggestions on how to remedy these errors?

11:21:51 β”‚ remix β”‚
11:21:51 β”‚ remix β”‚ πŸ’Ώ remix dev
11:21:51 β”‚ remix β”‚
11:21:51 β”‚ webhooks β”‚ Sending APP_UNINSTALLED webhook to app server
11:21:51 β”‚ remix β”‚ info building...
11:21:52 β”‚ remix β”‚ ✘ [ERROR] Could not resolve "react"
11:21:52 β”‚ remix β”‚
11:21:52 β”‚ remix β”‚ ../node_modules/@grapesjs/react/dist/index.js:1:150:
11:21:52 β”‚ remix β”‚ 1 β”‚ ...as C, memo as A, useMemo as Ne, createElement as Ve } from "react";
11:21:52 β”‚ remix β”‚ β•΅ ~~~~~~~
11:21:52 β”‚ remix β”‚
11:21:52 β”‚ remix β”‚ You can mark the path "react" as external to exclude it from the bundle, which will remove this error.
11:21:52 β”‚ remix β”‚
11:21:52 β”‚ remix β”‚
11:21:52 β”‚ remix β”‚ ✘ [ERROR] Could not resolve "react-dom"
11:21:52 β”‚ remix β”‚
11:21:52 β”‚ remix β”‚ ../node_modules/@grapesjs/react/dist/index.js:2:35:
11:21:52 β”‚ remix β”‚ 2 β”‚ import { createPortal as Tt } from "react-dom";
11:21:52 β”‚ remix β”‚ β•΅ ~~~~~~~~~~~
11:21:52 β”‚ remix β”‚
11:21:52 β”‚ remix β”‚ You can mark the path "react-dom" as external to exclude it from the bundle, which will remove this error.
11:21:52 β”‚ remix β”‚
11:21:52 β”‚ remix β”‚

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported `remix dev` build and inspect `../node_modules/@grapesjs/react/dist/index.js`, where imports of `react` and `react-dom` fail to resolve. Determine the package or setup change needed so both imports resolve, then confirm the Remix build completes without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.