Current versus Expected Behavior
I am experiencing very long build times when deploying my project to Vercel. The deployment often fails after the 45-minute timeout period due to taking too long to complete the build. I’m looking for advice on optimizing the build process or identifying the root cause.
Currently, the build logs show the process being stuck on some steps, but there are no obvious errors. My project uses Firebase for Firestore and Authentication, and I have set lazy loading for Firebase services in my SvelteKit project, but the problem persists.
I expect the build to complete within a reasonable time frame and successfully deploy.
Code, Configuration, and Steps to Reproduce the Issue
- Run the deployment on Vercel for a SvelteKit project with Firebase integration.
- Wait for the build to start.
- The build hangs and does not complete within the allowed 45 minutes.
Deployment URL or Custom Domain: https://www.sarpsborgmoske.no/
Environment: Production
Project Framework: SvelteKit
Build Settings:
Framework Preset: Svelte
Build Command: npm run build (default)
Output Directory: .svelte-kit/output (default)
Install Command: npm install (default)
Node/Runtime Version: 20.x
Package Manager: npm
Relevant Packages:
- @sveltejs/adapter-vercel
- firebase
- svelte
- vite
- @sveltejs/kit
Additional Details
I have already implemented lazy loading for Firebase to reduce the initial bundle size, but the build still takes a long time to complete. I am wondering if there’s something in the configuration or code that I might have missed that causes the deployment to hang. The build logs indicate some CSS warnings and package deprecations, but they don’t seem directly related to the deployment issue.
Here are some of the warnings I noticed in the logs:
- Unused CSS selectors
- Deprecated npm packages (e.g., rimraf, glob, npmlog)
Could these issues be causing the slow build times, or should I focus on something else?
Any advice on debugging or improving the build process for faster deployments would be greatly appreciated.
Thank you in advance!