microcipcip / cookie-universal

Universal cookie plugin, perfect for SSR
525 stars 39 forks source link

Property 'nodeCookie' does not exist on type 'NuxtCookies' #131

Closed doantu05150 closed 2 years ago

doantu05150 commented 2 years ago

I tried to write this line const parsed = this.$cookies.nodeCookie.parse(cookies) but getting error Property 'nodeCookie' does not exist on type 'NuxtCookies' I check the definition type file and no nodeCookie property found? Does anyone know what I am doing wrong?

microcipcip commented 2 years ago

Yeah I think the type definition is incomplete, is missing the nodeCookie so you can't reach it with typescript even if the method is indeed there.

stephenjason89 commented 2 years ago
image image

Hello @microcipcip I'm experiencing the same issue.

microcipcip commented 2 years ago

Ok, I'll try patch the ts definitions, a PR is also accepted.

stephenjason89 commented 2 years ago

My first PR https://github.com/microcipcip/cookie-universal/pull/135 😁

microcipcip commented 2 years ago

The PR is merged and I've also copied over PR #135 code for the ts definitions of cookie-universal-nuxt. I've also published a new version of the package (v2.2.2). Let me know if ts definitions now works. Thanks for the PR!

stephenjason89 commented 2 years ago

@microcipcip Everything is working fine on my end using v2.2.2. Thank you!

microcipcip commented 2 years ago

Amazing!