Skip to content

React Hook "useApolloServerErrors" cannot be called at the top level. #1369

Answered by n1ru4l
tettoffensive asked this question in Q&A
Discussion options

You must be logged in to vote

This is caused by an eslint rule https://www.npmjs.com/package/eslint-plugin-react-hooks

You should only enable that for your files that actually use React and disable it for your API routes, e.g. by adding /* eslint-disable react-hooks/rules-of-hooks */ on top of the file.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by n1ru4l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants