-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Invalid hook call. Hooks can only be called inside the body of a function component #77
Comments
Hello @OwenWheatley did you make any changes in the codebase of the starter or just the basic setup? |
Just did the basic starter, haven't changed the codebase. Even did a fresh gatsby new to double check. Here are the stack frames that came up if that helps at all Have you done a gatsby new of mate recently? |
So I've not been able to find anyone else who is up for running the mate starter (small circle I guess haha). I ran it on another computer I have and wanted to try this time doing it completely via the cygwin terminal as I noticed when you do After doing this I was still met with the same problem. I'm not too sure where to go at this point but will keep trying, I'm looking into using If anyone can provide any assistant or advice on what to go after that would be great. It would be nice to know if anyone else is having the same problem getting mate going :) |
Hello @OwenWheatley, sorry for the huge delay! So I made a quick test by bootstrapping a new instance and besides the issues of the latest version Do you still have the same issues? |
What OS are you on? What is the issue with the latest version of gatsby-source-contentful that you speak of? Is there something else besides what is in the readme that I must do for the setup. I am afraid I am still having the same issue... =/ |
I'm using macOS Mojave and I tried in a Windows 10 machine using Git bash as the terminal. In both cases, it worked 🤔 Btw, I just merged a new pr (#90) where I changed the package manager from |
Hello, I removed the warning from the docs because now it's not necessary :) The issue with Do you still have the react version issue or is it different now? |
Haven't had chance to go much further into it but I still had the issue. I'll just try hosting it and should be fine :D Probs spin up a linux vm to try it out. Thanks for all your help so far :) |
I've run into some weird issues with this happening in Gatsby. If it comes up again for anyone, you might want to try deleting .cache, node_modules, public folders and package-lock.json. Then run a full npm install again before firing Gatsby back up. |
_"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."_
This error comes up after running
npm start
when attempting to view mate on localhost.npm run setup
had been ran successfully and linked with contentful.After reading the react-invalid-hook-call facebook provides and going through the steps they recommend.
npm ls react-dom
returns a version of react greater than 16.8.0 so it's not that the project is missing hooks.When running

npm ls react
to check if there is a duplicate react within the project you can see that there is.Maybe I'm wrong about this being a problem with the starter and it's my own development environment that is messed up but I haven't had any problems running other starters? Hoping someone can help with this ^.^
The text was updated successfully, but these errors were encountered: