microcipcip / cookie-universal

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

warnings with nuxt3 #133

Open buddudevelopers opened 2 years ago

buddudevelopers commented 2 years ago

tried installing into a nuxt3 project got this warning

[warn] [nuxt] You are using a plugin with legacy Nuxt 2 format (context, inject) which is likely to be broken. In the future they will be ignored: ({ req, res }, inject) => {
  const options = {
  "alias": "cookies",
  "parseJSON": true
}
  inject(options.alias, __vite_ssr_import_1__.default(req, res, options.parseJSON))
}
microcipcip commented 2 years ago

Yes this project is only compatible with the previous version of nuxt. I am not currently planning to migrate it but you could in theory use the cookie-universal base library and create a custom plugin, is only a few lines of code.

Aybee5 commented 1 year ago

There's a composable now with Nuxt 3 useCookies that comes by default