#react shadcn astro randomly throws

3 messages · Page 1 of 1 (latest)

rocky kraken
#

using react shadcn and astro with client:load throws invalid hook call errors if I use client:only these errors disappear

See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
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:
1. You might have mismatching versions of React and the renderer (such 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 https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
10:11:02 [ERROR] Cannot read properties of null (reading 'useCallback')
  Location:
    /Users/x/node_modules/@radix-ui/react-compose-refs/node_modules/react/cjs/react.development.js:1456:33
  Stack trace:
    at process.env.NODE_ENV.exports.useCallback (/Users/x/node_modules/@radix-ui/react-compose-refs/node_modules/react/cjs/react.development.js:1456:33)
    at TooltipTrigger (file:///Users/x/node_modules/@radix-ui/react-tooltip/dist/index.mjs:170:26)
    at renderWithHooks (/Users/x/node_modules/react-dom/cjs/react-dom-server.node.development.js:4797:19)
#

hmm deleting all node_modules and installing individually per app under turbo repo fixed this problem

inland veldtBOT
#
If your issue is resolved, please help by doing the following two steps:
  1. From the ellipses (3-dot menu) in the top-right corner of the post (not the first message), edit the tags to include the Solved tag.
  2. From the same ellipses, select Close Post.
    Your post will still be available to search and can be re-opened simply by replying in it. Closing a post moves it down with older posts, so we can more easily focus on issues that still need to be resolved.
    Thank you for your help!