nuxt-mongoose icon indicating copy to clipboard operation
nuxt-mongoose copied to clipboard

Nuxt 3.11 - Error: Context is not available

Open lupus78 opened this issue 11 months ago • 1 comments

On the recent Nuxt 3.11 I see this error, and the app is not starting:

✔ Connected to MongoDB

 ERROR  Error connecting to MongoDB: Error: Context is not available

I did some digging, and I think this is realted to the new feature of showing the server side console.log-s on the client side. See: https://nuxt.com/blog/v3-11#better-logging

If I disable the devLogs like so, the app is working again:

nuxt.config.ts

export default defineNuxtConfig({
  features: {
    devLogs: false
    // or 'silent' to allow you to handle yourself with `dev:ssr-logs` hook
  },
})

Can this be because nuxt-mongoose uses the consola wrapper for console.log?

lupus78 avatar Mar 18 '24 13:03 lupus78

@lupus78 I can't reproduce this, can you share a small reproduction? thanks

arashsheyda avatar Mar 20 '24 16:03 arashsheyda

I wasn't able to reproduce with the latest version 1.0.6

lupus78 avatar May 23 '24 11:05 lupus78