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

Stuck generating types in CLI #19

Closed negativems closed 9 months ago

negativems commented 10 months ago

Nuxt gets stuck when generating types, and removing nuxt-mongoose fixes the issue.

image

I tried:

Additionally, I attempted to deploy it on Vercel and encountered the same issue.

I still face this problem even when removing all files that have the implementation of the module but the issue occurs only when I have it on nuxt.config.ts.

I also attempted to downgrade Nuxt from version 3.7.0 to 3.6.5, but this did not resolve the issue.

I found a similar issue here, and they suggested it might be related to the modules and not Nuxt itself: https://github.com/nuxt/cli/issues/169

TgMrP commented 10 months ago

I have the same problem

mariagq777 commented 9 months ago

Me too... the same issue :(

leaderit commented 9 months ago

And me (

For this times the only work around for me is

comment uri parameter in moongoose settings, like this:

mongoose: {
    // uri: 'mongodb://'+ ( process.env.MONGODB_URL || 'localhost:27017' ),
    options: {
        dbName:'db_name'
    },
    modelsDir: 'models',
},

I've had a warning:

WARN Missing MONGODB_URI in .env

and

✔ Types generated in .nuxt

is OK.

MONGODB_URI variable in your enviroment MUST NOT be set too.

The problem looks like mongoose try to connect a database server and do something with a server when types generate...

wbr, Valerii

ps: and, unfortunaly, it stops production build via 'npm build' too .

arashsheyda commented 9 months ago

Sorry I was away for a while and didn't have internet access :( It is probably caused by updates, and I'll try to fix it asap