docz: The above error occurred in the component
Bug Report
Version: 2.0.0-rc.68
The error occur when I npm run dev. Go wrong in 2.0.0-rc.68, but not happen in 1.3.2.
Error Info:
Building app
The above error occurred in the <StoreStateProvider> component:
in StoreStateProvider
in App
React will try to recreate this component tree from scratch using the error boundary you provided, App.
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 22
- Comments: 30 (5 by maintainers)
Thanks! It works!
But it seems I have to use
yarn
.At first, I use
npm install
, and the same problem occur. Then I useyarn
, it works.@chhuang Interestingly, it solves the issue for me, too, if I remove
node_modules
and reinstall them withyarn
But I believe that docz should of course support both
npm
andyarn
.I guess we should find out what exactly leads to this inconsistency. Perhaps
docz
depends on some package that has yarn-specific behavior.The app itself works fine with
npm
.I ran into this same issue and as @kinsomicrote mentioned it seemed to be related to the Gatsby issue. Removing
node_modules
,yarn-lock
and reinstalling withyarn
fixed it for me.Using
yarn
instead ofnpm i
solved the issue.damn, so weird that deleting node_modules and switching to yarn only fixes it, this is the sort of issues I hate, infrastructure/tooling stack issues that are hard to trace the cause of, it could be npm caching or anything else. and what was the cause? upgrading a package by bumping up a version in package.json and
npm i
ing.here is the full output:
PS: I’m using only Gatsby, not docz.
With
npm
upgradingreact
andreact-dom
to16.12.0
and reinstallingnode_modules
fixed the problem for mehow can I get this working with npm?.. It’s not possible for me to migrate to yarn right now
I’m having the exact same issue. I’m not using any additional docz plugins, though. Basically, I have this:
I’m running docz as
./node_modules/.bin/docz dev
I have this output: