You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Prevents database connection issues during build
Addresses issues where database connections during build or prerendering could cause the build process to hang.
This is achieved by:
- Adding a utility to detect build time based on environment variables and process arguments.
- Excluding the nuxt-users API routes from Nitro's prerendering process, preventing premature database access attempts.
- Skipping database connection checks during the build phase to prevent build failures.
- Throwing an error if a database connection is attempted during build time to signal misconfiguration.
This ensures a more robust build process and prevents unexpected errors due to database unavailability during build time.
// During build/prerendering, throw an error to prevent hanging
49
+
if(isBuildTime()){
50
+
thrownewError('[Nuxt Users] Database connections are not available during build/prerendering phase. This should not happen - please check your prerender configuration.')
0 commit comments