Skip to content
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

Cannot read properties of undefined (reading 'getSession') #805

Open
2 tasks done
vednig opened this issue Sep 3, 2024 · 0 comments
Open
2 tasks done

Cannot read properties of undefined (reading 'getSession') #805

vednig opened this issue Sep 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vednig
Copy link

vednig commented Sep 3, 2024

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I am using this template to build my project there are very few auth changes I made nothing major, and I was able to run the project in my server earlier.
But after stopping making changes and then running I get image error
Which most probably is error with 'supabase-js' or 'auth-helpers-nextjs'.

I tried moving versions as suggested here

Also, viewed the documentation but could find a fix.

I also viewed the supabaseClient class in code but I couldn't find a getSession() in auth

Happening with createServerComponentClient class
PS: Documentation suggests there is a getSession. It's most probably a bug.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Go to 'shedtheshade.com'
or
Clone the template
Enter values,keys
Load modules and run project in dev or prod

Expected behavior

Everything was working fine before updating.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: running on Linux - Ubuntu
  • Browser (if applies) tested on all versions of chromium based browsers on Android and Windows
  • Version of supabase-js: 2.31.0,1.83.5,2.45.3
  • Version of Node.js: 20.17.0

Additional context

 ○ Compiling / ...
 ✓ Compiled / in 18.3s (2356 modules)
⨯ src/app/(dynamic-pages)/layout.tsx (15:33) @ getSession
 ⨯ TypeError: Cannot read properties of undefined (reading 'getSession')
    at fetchSession (layout.tsx:22:68)
    at RootLayout (layout.tsx:38:9)
    at stringify (<anonymous>)
digest: "3794228426"
  13 |     data: { session },
  14 |     error,
> 15 |   } = await supabaseClient.auth.getSession();
     |                                 ^
  16 |
  17 |   if (error) {
  18 |
 ⨯ src/app/(dynamic-pages)/layout.tsx (15:33) @ getSession
 ⨯ TypeError: Cannot read properties of undefined (reading 'getSession')
    at fetchSession (layout.tsx:22:68)
    at RootLayout (layout.tsx:38:9)
    at stringify (<anonymous>)
digest: "3794228426"
  13 |     data: { session },
  14 |     error,
> 15 |   } = await supabaseClient.auth.getSession();
     |                                 ^
  16 |
  17 |   if (error) {
  18 |
GET / 500 in 19214ms
@vednig vednig added the bug Something isn't working label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant