-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck trying to run docz dev #707
Comments
Ran into this today and looked in the Make sure you're running the following versions of React in the project you have Docz on:
After that, blast away the What's interesting is that I don't see any peer dependencies stating the version of React that needs to be installed to run the project. @pedronauck Happy to put in a PR to update the Readme and add the specific React version to the |
What @mwood23 told should fix this problem. |
@pedronauck It doesn't. |
|
It is probably because, docz, and docz-theme-default not using react and react-dom as peerDependency. Unfortunately I don't know if the right way to fix this problem is make a pull request with dependency as peerDependency. So I can present workaround. I'm using npm so i've installed that library (https://github.com/rogeriochaves/npm-force-resolutions). That lib forces our dependencies to use only one library (without duplicated). So after installation I added this to my package.json
And docz works again ;) |
Still got this error: But build and dev works fine though |
Hey guys, i've got the same problem, my package.json looks like this: { can anyone help? |
same issue |
How I & @alexhawkins fixed it My situation was that I have a monorepo that's managed by npm scripts, no monorepo tool like Lerna. I have a frontend folder that contains all of our Gatsby apps. The frontend repo package.json has
Should work out. For people reading this in the future, your |
After trying all of the above, I also found that upgrading to V1 results in the same stack trace no matter how I fix versions of React, etc.
|
I also ended up with double React installations in my project when trying to use a custom theme from a separate repo that was linked locally with npm link. I could get around it by deleting react from the theme's node_modules and symlinking the doc project's react to the theme's node_modules... But I encountered some other issues and gave up on having my theme in a separate repo. |
Ditto. Same package versions, tried adding a |
Any updates on this? I too tried pinning react to 16.8.6, removed node_modules and package-lock.json to get deduped react versions, but still encounter this error |
Would something like this help? #882 |
A coworker recommended set api.cache(true) in babel.config.js if you use it to get it working. |
rebuilding the |
Still getting this error. Pinned deps were working but not no more |
Hey @hipstersmoothie Could you please provide the docz version you're using ? |
I get this problem on latest of the v1 releases. Seeing as v2 seems to have stalled out on the infinite RC status I worry about this package stability for either major version. |
Hey @wldcordeiro V2 will get out of RC status next Monday November 25. Did you give it a try ? I encourage you to try it and if you face any problems we'll be happy to help ! Or feel free to wait for next week 👍 |
@rakannimer Just wanted to mention that the errors will still be displayed in console in v2 when |
Hey @Clarity-89 I'm not sure which errors are appearing. Any chance you can provide a repro or tell me more about your project where it's happening ? |
@rakannimer The errors related to the types:
Unfortunately the project is commercial code, so can't really share the repo. It's basically a monorepo UI component library managed by Lerna. I wonder if the error could be due to some of the dependencies? It does not seem to impact the running app in any way tho. |
@rakannimer I was able to reproduce the warning in a small monorepo with one package. You can find it here: https://github.com/Clarity-89/uikit.
The error shows after Let me know if you need any more info. |
I'm still having this issue. If I install Docz in my React app, I get more than one copy of React in the same app: I tried using npm force-resolutions and it does not solve this issue in my case. I've noticed that Docz uses the following versions of react and react-dom: And my project is using 16.13.1, could this be the issue? Please any help would be very much appreciated! |
Just tried docz rc 1.0.0 rc3 and got the following multiple instances of error:
✖ fatal Error parsing static types
✖ error Error: No suitable component definition found.
at parse (/Users/bugzpodder/ui/node_modules/docz-core/node_modules/react-docgen/dist/parse.js:70:13)
at Object.defaultParse [as parse] (/Users/bugzpodder/ui/node_modules/docz-core/node_modules/react-docgen/dist/main.js:64:29)
at resolve (/Users/bugzpodder/ui/node_modules/docz-core/dist/index.js:1412:38)
at new Promise ()
at jsParser (/Users/bugzpodder/ui/node_modules/docz-core/dist/index.js:1409:12)
at Promise.all.files.map (/Users/bugzpodder/ui/node_modules/docz-core/dist/index.js:1430:15)
at Array.map ()
at docgen (/Users/bugzpodder/ui/node_modules/docz-core/dist/index.js:1427:42)
Turning debug: off and the UI is stuck at this:
● Docz █████████████████████████ building (10%) 2/4 modules 2 active
../node_modules/url/url.js
After about 5 minutes I get a build success with the following UI 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:
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
The text was updated successfully, but these errors were encountered: