Packages upgrade in v0.24.0 introduce many breaking changes
@satya164 ci sta già lavorando.
Dal 4/11/2020.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Environment
- macOS 10.15
- Node.js 12.18.4
component-docs@ 0.24.0
Description
Although the example in this repo work as expected, if we use component-docs@0.24.0 as a dependency in another project, the new version breaks the serve as well as build command like in below screenshot:
Another escalation of the issue I found out next is that, if my main project has react as direct dependency but its major version is different from component-docs@0.24.0's one (which is ^17.0.1). Say, my project still has react@^16.14.0, then when I execute the component-docs serve command, I got this error:
Error: Cannot find module '@mdx-js/tag'
...
I have to install @mdx-js/tag as direct dependency now, then get a couple of errors regarding missing: react-dom and redbox-react. However, once I installed those missing dependencies, I get this run time error:
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:
1. You might have mismatching versions
of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
Reproducible Demo
cd into example folder, and init a package.json. Add component-docs@0.24.0 as dependency and with some scripts like so:
{
"name": "test-component-docs",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"build": "component-docs build",
"docs": "component-docs serve"
},
"devDependencies": {
"component-docs": "^0.24.0"
}
}
- First execute
yarn docsand observe the broken layout of the preview site. - Add
react@16.14.0as direct dependency and observe the compile time error - Add the missing dependencies and observe the errors.
Suggestion
I don't know what happen yet but regarding the mismatch react version, I think we should move react, react-dom to devDependencies and peerDependencies so that component-docs should use the react version in consuming projects and avoid versions conflict.
- Lingua principale
- TypeScript
- Stelle
- 141
- Fork
- 12
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di callstack/component-docs
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
callstack/component-docs#48 · 1 reazione ·
-
Add support for iframe Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
callstack/component-docs#44 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
callstack/component-docs#34 ·
-
Support RNW Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
callstack/component-docs#30 · 1 reazione ·
-
greenkeeper
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
callstack/component-docs#18 ·
Tutte le issue di callstack/component-docs
Issue simili
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Apertaclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
supermomonga/zcode-acp#24 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
growthbook/growthbook#7100 ·
-
triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100