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 property 'get' of undefined (cookie)

See original GitHub issue

After installed your module, i had got a fatal error “Cannot read property ‘get’ of undefined” with getToken method in .nuxt/strapi.js line 148 on all pages.

getToken () { return this.$cookies.get(TOKEN_KEY) }

I don’t understand why do you retrieve token in constructor because to register we don’t need a jwt-token.

Version

@nuxtjs/strapi: 0.1.7 nuxt: 2.14.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

7reactions
gkkirilovcommented, Jun 8, 2021

@dimst I had to change the order of the modules in nuxt.config.js, I put strapi first and it worked

1reaction
T-Zahilcommented, Oct 25, 2020

You can use this.$strapi.$cookies (https://strapi.nuxtjs.org/strapi#cookies)

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'cookie' of undefined
When calling my User.create method in my Sails.js app, I get the following error:.
Read more >
Cannot read property 'get' of undefined (cookie) #60 - GitHub
After installed your module, i had got a fatal error "Cannot read property 'get' of undefined" with getToken method in .nuxt/strapi.js line ...
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 >
cookieControl-9.0.min.js:1 Uncaught (in promise) TypeError
cookieControl-9.0.min.js:1 Uncaught (in promise) TypeError: Cannot read property 'analytics' of undefined. My optionalCookies object looks like this:.
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError: Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an undefined...
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