matthewmueller / next-cookies

Tiny little function for getting cookies on both client & server with next.js.
368 stars 17 forks source link

Require component-cookie dynamically #1

Closed worm-emoji closed 7 years ago

worm-emoji commented 7 years ago

The current code was causing issues in the browser with next@3.0.1-beta.19. Was getting an error on client side page changes:

Can't find variable: cookie
Cookies
_callee$
tryCatch
invoke
step
Promise

tryCatch
invoke
step
Promise

tryCatch
invoke
step
Promise

tryCatch
invoke
step
Promise

tryCatch
invoke
step
Promise

I'm not sure if this is the best fix, but doing the require dynamically fixes the bug. Perhaps this is next related as well. (also hi matt it's been a long time : ) 👋 )

matthewmueller commented 7 years ago

hey @lukemiles good to hear from you!

hrm, the only thing i can think of is that next.js changed the way they resolve things. anyway the change is in next-cookies@1.0.2. thanks for the fix!