[Vuejs]-Trying to connect to a redis client from nuxt 3 middleware but the connection is undefined

0👍

It seems you’re only running the Redis request during the server side part. Making it lose context when client side routing happens.

export default defineNuxtRouteMiddleware(async (to, from) => {
  let session = '';
  if (process.server) {
    session = 'has some context';
  }

  // server: session = 'has some context'
  // client: session = ''
})

Leave a comment