FormidableLabs / FormidableLabs/react-live
React Invariant thrown during Next.js `next build`
- Dominant language
- TypeScript
- Stars
- 4.6k
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
With, `npm ls react` you can see `react@16.14.0` is **not deduped**, and everything else is on `react@17.0.2`
```
...
├─┬ react-dom@17.0.2
│ └── react@17.0.2 deduped
...
├─┬ react-live@2.4.0 (...same issue w/ 2.3.0)
│ ├─┬ prism-react-renderer@1.2.1
│ │ └── react@17.0.2 deduped
│ └─┬ react-simple-code-editor@0.11.0
│ ├─┬ react-dom@16.14.0 <-----------------not deduped
│ │ └── react@16.14.0 deduped
│ └── react@16.14.0 <-----------------not deduped
...
├── react@17.0.2
...
```
I _believe_ this is preventing my Next.js project from building, due to the [more than one copy of React](https://reactjs.org/warnings/invalid-hook-call-warning.html) React invariant.
... strangely it only happens when installing everything w/ `npm` and not `yarn`
---
Side: `react-simple-code-editor` https://github.com/satya164/react-simple-code-editor/blob/master/package.json#L62-L65 doesn't specify `react/-dom 17` as a peer dependency. (It also hasn't seen a new update in close to 2 years now :/)
Update: Opened a PR to allow react 17 as a peerDep
- https://github.com/satya164/react-simple-code-editor/pull/89
Contributor guide
Assessment
This issue has not been assessed yet.