question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read properties of undefined (reading 'cookies')

See original GitHub issue

I’m having the same issue as @miguelramos in the closed issue he commented on: https://github.com/nuxt-community/supabase-module/issues/24#issuecomment-1095741230_:

nuxt-config.ts

supabase: {
    url: process.env.SUPABASE_URL,
    key: process.env.SUPABASE_KEY,
  },
  modules: ['@nuxtjs/supabase', '@pinia/nuxt'],

"@supabase/supabase-js": "^1.33.3" "@nuxtjs/supabase": "^0.1.7" "nuxt3": "latest"

Won’t compile without a 500 error and:

[nitro] [request error] Cannot read properties of undefined (reading 'cookies')
  at Module.useSupabaseToken (./.nuxt/dist/server/server.mjs:8682:32)  
  at Module.useSupabaseClient (./.nuxt/dist/server/server.mjs:2937:39)  
  at ./.nuxt/dist/server/server.mjs:9123:40  
  at fn (./.nuxt/dist/server/server.mjs:350:27)  
  at Object.callAsync (./node_modules/unctx/dist/index.mjs:41:19)  
  at callWithNuxt (./.nuxt/dist/server/server.mjs:352:23)  
  at applyPlugin (./.nuxt/dist/server/server.mjs:307:29)  
  at Module.applyPlugins (./.nuxt/dist/server/server.mjs:317:11)  
  at async createNuxtAppServer (./.nuxt/dist/server/server.mjs:44:7)  
  at async renderToString (./node_modules/vue-bundle-renderer/dist/index.mjs:247:19)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

4reactions
Atinuxcommented, Apr 12, 2022

Can you update to latest Nuxt edge release and try again please @SkySor44 ?

See more context in https://github.com/nuxt/framework/pull/4283

Sorry about this issue, living on the edge might be dangerous 😄

2reactions
larbishcommented, Apr 13, 2022

Can you please try to update to the last version of the module (0.1.8). Should be fixed !

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'cookie' of undefined
req.session.cookie is not defined and you are trying to set a value to an undefined object. var oldDateObj = new Date(); var newDateObj ......
Read more >
Cannot read property 'cookie' of undefined · Issue #3 - GitHub
I'm currently working with socket.io and the client sends a request but apperently the req.headers is undefined. So in the index.js file on...
Read more >
Cookies, document.cookie - The Modern JavaScript Tutorial
We can write to document.cookie . But it's not a data property, it's an accessor (getter/setter). An assignment to it is treated specially....
Read more >
Cannot read property 'set' of undefined - Laracasts
... I receive this error : "Cannot read property 'set' of undefined" It says it's a javascript error, if (Cookies.get('XSRF-TOKEN') !== undef.
Read more >
Uncaught TypeError: Cannot read properties of undefined ...
Uncaught TypeError: Cannot read properties of undefined (reading 'cookie_value_disagreed') ... EU Cookie Compliance (GDPR Compliance).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found