arashsheyda / nuxt-mongoose

A Nuxt module for simplifying the use of Mongoose in your project.
https://docs.arashsheyda.me/nuxt-mongoose
69 stars 11 forks source link

Nuxt 3.11 - Error: Context is not available #50

Closed lupus78 closed 1 month ago

lupus78 commented 3 months ago

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?

arashsheyda commented 3 months ago

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

lupus78 commented 1 month ago

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