reactjsgatsbyjamstackgatsby-plugin-feed

Gatsby site breaks after installing plugins


I run into a problem when installing gatsby plugins.

My Setup:

npm install -g gatsby-cli
gatsby new my-app
gatsby develop

When I try to install a plugin from the Gatsby library im getting this error message after installing the plugin:

Error: Invalid hook call. Hooks can only be called inside of the bo dy of a function component. This could happen for one of the follow ing reasons:

  1. You might have mismatching versions of React and the renderer (s uch 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 fb.me/react-invalid-hook-call for tips about how to deb ug and fix this problem.

Is there something wrong with my dep tree?

├─┬ gatsby@2.23.10
│ └─┬ gatsby-cli@2.12.50
│   └── react@16.13.1  deduped
└── react@16.13.1 

Solution

  • According to the comments above the solution was:

    Removing node_modules and .cache folder, reinstalling dependencies via npm install and gatsby develop.