frankcollins3 / Next-Water-App

Happy, Healthy Water Cycling App that tracks user/human fluid intake.
https://next-water-app.vercel.app
1 stars 0 forks source link

Error: could not find react-redux context value APP.tsx [12:17am] #47

Closed frankcollins3 closed 1 year ago

frankcollins3 commented 1 year ago

attempting to do: use an apollo-server-micro query, to invoke a prisma.users.findMany() promise that returns userdata from postgres DB. This data set as @redux/toolkit state to be used through app, in this case to check if a username exists for signup process

error: Screen Shot 2023-07-15 at 12 08 10 AM

 1 of 1 unhandled error
Server Error
Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
pages/_app.tsx (41:30) @ App

  39 | 
  40 | export default function App({ Component, pageProps }: AppProps) {
> 41 | const dispatch = useDispatch()
     |                            ^
  42 | 
  43 | 
  44 | 
Show collapsed frames

proposed approach: can perform the same functionality in /logInOutGoogle.tsx but this worked in react-express no problem with react-redux & connect-redux

frankcollins3 commented 1 year ago

moving useDispatch() to a next /pages/component.tsx instead of the app.tsx-><Components{pageProps}/> works. [1:20am]