content icon indicating copy to clipboard operation
content copied to clipboard

Nuxt content causing an infinite build process with mongoose in nitro plugins

Open GalacticHypernova opened this issue 2 years ago • 0 comments

Environment



Reproduction

https://stackblitz.com/edit/github-ftqn23?file=pages%2F[...slug].vue,nuxt.config.ts,server%2Fplugins%2Fstartup.ts

Other prerequisites:

  1. Must have a valid mongodb database connection present on the local machine set on localhost with port 27017 with a database called "test"
  2. Must run it on the local machine, as that's where the issue is present (tested specifically on ubuntu. but I doubt that much can make a difference)

For more information, please refer to https://discord.com/channels/473401852243869706/1002541842409193563/1168471513842864128 (in the Nuxt discord)

Describe the bug

When using @nuxt/content, during the server build process the prerenderer gets initialized to prerender routes. This causes the server plugins to execute, which run ~/server/plugins/startup.ts. When the connection is valid and runs as expected, it is connected before the build is done, and when the build process finally reaches the ending message of "you can preview this build...." it never actually finishes, and the build must be stopped using ctrl + c, otherwise it hangs indefinitely.

Additional context

The plugin appears to run correctly but during the hang there are no error messages, which make it extremely hard to debug. If this cannot be reproduced, I would happily share my screen showcasing the behavior.

Logs

No logs are given, no error messages, nothing.

GalacticHypernova avatar Oct 31 '23 14:10 GalacticHypernova