The Day VS Code Became a Fucking Space Heater

Around 2,800 components, VS Code started taking forever to boot up. By 3,200, I was waiting like 90 seconds for it to start and my MacBook Pro sounded like it was about to launch into orbit.

The language server was eating RAM like crazy - topped out at something like 8GB before crashing with "JavaScript heap out of memory." Helpful error message, right? Tells me exactly jack shit about what's wrong.

The Exact Moment It All Goes to Hell

I used to defend SvelteKit. "It's just tooling issues," I'd say. "They'll fix it in the next release." Yeah, well, that was 6 months ago and my laptop still sounds like a jet engine when I open our main project.

The whole enterprise architecture promise falls apart when you actually try to scale. The tooling ecosystem just isn't built for the complexity of real production systems.

Language Server Crashes Every Fucking Day: Had to pin the VS Code extension at v108.5.2 because v108.6.0+ crashes within 15 minutes on our codebase. Found that GitHub issue about it - #2738 - 847 comments, no real fix, just people switching to vim to get work done. We're running `--max-old-space-size=8192` plus --max-semi-space-size=1024 just to keep it limping along for more than 20 minutes.

The memory usage just keeps climbing - starts around 2GB, hits 4GB after a few hours, then 6GB, until it finally crashes around 8GB. It's not a gradual leak either - certain operations just eat massive chunks of memory and never give it back.

Build Times Are Insane: Production builds take 27-32 minutes on our CI depending on which GitHub runner we get. `svelte-check` alone eats up 14+ minutes to tell me about shit TypeScript caught 3 hours ago in my IDE. That's when it doesn't randomly fail with svelte-check failed with exit code 2 and zero helpful output. I started running builds on Friday afternoons because that's the only time I can afford to lose 45 minutes when it inevitably fails and needs a retry.

Dev Server Takes Forever: Cold starts are brutal - sometimes 2 minutes if you're unlucky. And when you change a route? Kiss your flow goodbye, you're waiting another minute. I've literally made coffee during hot reloads.

Production Performance: A Complete Shitshow

Our monitoring dashboard tells the brutal story: response times that spike from 120ms baseline to 4,200ms randomly, memory usage that climbs from 512MB to 2.8GB per pod before OOM kills kick in, and 95th percentile response times that make you question every life choice that led to using SvelteKit in production.

SvelteKit talks a big game about performance, but try throwing any real traffic at it. We had API routes handling 11k requests per second and needed 203 pods just to keep error rates under 2%. For fucking proxy calls that should run on a single Express server.

That's when I realized SvelteKit's request handling is garbage. Every request goes through this whole compilation pipeline even for basic API stuff. We said screw it and ripped out all the API routes, built a proper Express server instead. Cut our pod count to like 20 and our AWS bill in half.

Security Headers and Other Enterprise Nightmares

Remember when I thought adding security headers would be simple? Just configure a few HTTP headers, right? Wrong. SvelteKit's adapter system is hot garbage for anything real.

When you're building for enterprise, you need proper middleware architecture. SvelteKit forces you into these hacky Vite plugin patterns that break everything.

So you need OpenTelemetry tracing. Cool, just add middleware, right? Nope. You get to modify build/index.js by hand after every build and pray it doesn't break in production. Spent 3 fucking weeks getting compliance headers to work consistently across environments.

Shit That Should Be Easy But Isn't:

When Microfrontends Become Your Only Hope

By month 8, the monolith was completely unmaintainable. Build times were insane, merge conflicts everywhere, and new devs took weeks to understand the codebase.

"Let's do microfrontends!" I said. How hard could it be?

Well, `vite-plugin-federation` doesn't work with SvelteKit. At all. Throws some cryptic error about module resolution and dies. So I spent a month building our own component loading system. A fucking month. On something Webpack solved years ago.

Bundle Visualization

The kicker? It sort of works, but now we have 6 different build pipelines that all break in different ways. I'm not even sure this is better than the monolith we started with.

Our Test Suite is Completely Fucked

We have like 2,800 Playwright tests and maybe 60% of them pass on any given day. Not because the app is broken - the tests are just flaky as hell.

SSR mocking is impossible. You know how normal frameworks let you mock HTTP requests? Yeah, SvelteKit's SSR doesn't work that way. Had to rewrite our entire mock server twice. Still doesn't work right.

Hydration timing is a nightmare. Playwright clicks buttons before SvelteKit finishes loading and half the tests explode. Added `waitForSelector` calls everywhere but now each test takes forever and sometimes times out anyway.

The worst part? `+page.js` does weird shit with data serialization that breaks everything. Can't mock at the HTTP level like a normal person. Everything has to be mocked way down in the data layer and it's slow and breaks constantly.

The Rolldown "Fix" That Ate My RAM

Everyone was excited about Vite 7 with Rolldown. "Finally, fast builds!" they said. Yeah, right.

I tried it on our project and the builds got maybe 20% faster. Sounds good until you realize the bundles got bigger and now my laptop needs like 8GB of heap just to compile without crashing.

Oh, and half our dependencies don't work because they export weird shit that Rolldown doesn't like. So now I'm debugging npm package exports instead of building features.

It's fucking 2025 and I'm tweaking Node.js memory flags to compile JavaScript. How did we get here?

But wait, it gets worse. Node.js v18.12.0 has a memory leak in WSL2 that kills the dev server every 90 minutes. Node v18.15.0 fixed the leak but broke ES module resolution for half our dependencies - kept getting Error [ERR_MODULE_NOT_FOUND]: Cannot find module for packages that definitely exist. Node v20.8.1 works great until you hit the new garbage collector that's somehow slower than the old one.

We're stuck on Node v18.14.2 which works but randomly crashes VS Code when the extension tries to spawn TypeScript processes. Every Node version is broken in a different, creative way.

Node.js Logo

When the CTO Asks "Why Is This Taking So Long?"

The technical shit is bad enough, but explaining to management why everything is broken gets old fast.

Hiring is fucked. Posted a senior frontend role, got 200 React applications, maybe 3 people who'd touched Svelte. Tried interviewing React devs anyway - total disaster. The mental model is just different and they don't get it.

Ecosystem is basically empty. Need a calendar component? Hope you like spending 2 weeks porting some React thing. Auth library? Build it yourself. Everything has to be custom.

I keep seeing people mention Yahoo Finance runs SvelteKit successfully. Yeah, well, Yahoo probably has a team of 15 engineers whose entire job is making SvelteKit not suck. We have me and two other devs who just want to ship features.

Should've stuck with Next.js. At least when Next breaks, Stack Overflow has answers.

Questions No One Wants to Answer

Q

At what point does SvelteKit just stop working?

A

For us it was exactly 3,768 components and 15,328 TypeScript files. VS Code takes 87 seconds to start up and my MacBook Pro hits 94°C within 5 minutes of opening the project.

The language server crashes every 22 minutes on average with `FATAL ERROR:

MarkCompactCollector: semi-space copy, fallback in old gen Allocation failed

  • JavaScript heap out of memory` even with 8GB allocated. We measured this shit because management kept asking "how bad could it be?"
Q

How many devs can you have before everything breaks?

A

We topped out at 12 developers before it became impossible. Everyone's stepping on each other's code, merge conflicts happen 3-4 times per day minimum, and our CI queue backs up for 4+ hours during busy periods. Had 6 PRs stuck in queue Tuesday morning because our builds take 32 minutes and GitHub only gives us 2 concurrent runners on our plan. SvelteKit really wants you to build a monolith and monoliths don't scale with teams that actually want to ship features.

Q

When do build times become completely unusable?

A

Our CI went from 8 minutes to 32 minutes and I can pinpoint exactly when it happened

  • when we hit 2,800 components.

Just suddenly every build takes forever and fails randomly with Error: Command failed: npx svelte-check --tsconfig ./tsconfig.json and no other useful information. `svelte-check` by itself takes 16+ minutes to tell me about type errors TypeScript caught locally 3 hours ago. Developers stopped running it locally because nobody has 20 minutes to sit around watching progress bars crawl. We're paying GitHub $200/month just for the privilege of waiting longer for builds.

Q

Does SvelteKit actually work in production?

A

Static sites? Sure. Anything with real traffic? Good luck. We tried to handle maybe 8,000 requests per second through SvelteKit API routes and needed a ridiculous number of pods. I think it was like 150 or 180, something insane. For simple proxy calls!

Ended up ripping out all the API stuff and building a normal Express server. Problem solved, AWS bill cut in half.

Q

How the hell do you add security headers?

A

This one still pisses me off. Something that should take 30 minutes took us 3 weeks. SvelteKit's adapters are hot garbage for anything beyond static files.

You have to write custom Vite plugins that break every time you update anything. Or modify build outputs manually after every deploy. Security headers disappear randomly between dev and production. It's insane.

Q

What do you do when it all falls apart?

A

We're honestly thinking about rewriting the whole thing in Next.js. Six months into this SvelteKit experiment and I feel like we've learned nothing except how to work around broken tooling.

Built our own microfrontend system with dynamic imports because the existing plugins don't work. Took months. Webpack had this figured out in like 2018 but here we are reinventing the wheel.

Q

Will Svelte 5 fix any of this?

A

God no. Svelte 5 changes the entire mental model with runes. Tried migrating a subset of our components and gave up after a week. For a big codebase it would mean rewriting like half the app.

So your options are: stick with current broken shit, or spend months migrating to new broken shit. Great choices.

Q

How long did your migration take?

A

We started January 8th and we're still not really done 18 months later. When we started, everyone said "6 weeks for an experienced team." What a fucking joke.

Three months just porting React components - our date picker alone took 2 weeks because React DatePicker uses refs everywhere and SvelteKit handles DOM differently. Another two months rewriting all 2,847 tests because SvelteKit's SSR breaks normal mocking patterns. Six months building our own microfrontend system, auth middleware, and monitoring that should've existed already. Then 4 more months debugging why our Docker builds randomly fail with Error: spawn ENOMEM on the same hardware that built our React app fine.

If I had to do it again I'd just stick with React and spend the time building actual features instead of fighting frameworks.

Q

Why is everything built for React and nothing for Svelte?

A

Because React has like 80% market share and Svelte has maybe 2%. Simple math.

Need a calendar component? Hope you like porting React code for a week. Want auth that isn't homebrew garbage? Build it yourself. Data visualization? I spent a month trying to get Chart.js to work properly with Svelte's reactivity and gave up.

We've ported so many React components at this point I could do it in my sleep. Doesn't make it less annoying.

Q

How's monitoring and observability?

A

It sucks. Sentry sort of works but setting it up with SSR is a pain in the ass. DataDog integration took like 3 weeks because SvelteKit does weird shit with request handling that breaks normal APM.

We ended up building custom instrumentation for everything. What Next.js gives you out of the box, we had to code from scratch.

Q

What about deployment?

A

The adapters work great if you want to deploy a blog. For anything real you're building custom deployment pipelines. We needed feature flags, staged rollouts, proper monitoring - none of that exists.

Our deployment setup is basically entirely custom at this point. Months of work that should've been a config file.

Q

When do developers actually become productive?

A

It's been 8 months and I'd say maybe half the team is comfortable with it. React devs think they'll pick it up in a couple weeks - that's just the syntax. The real SvelteKit patterns, SSR weirdness, and tooling quirks take forever to learn.

Two senior devs already asked to transfer to other projects. Can't blame them.

How SvelteKit Stacks Up (Spoiler: Badly)

The Shit That Matters

SvelteKit (Our Mistake)

Next.js (What We Should've Used)

IDE Performance

Crashes at 3,768 components, takes 87 seconds to start VS Code, 94°C MacBook Pro

Handles 12k+ components, starts in 8 seconds, laptop stays cool

Team Size

12 people max before daily merge conflicts and 4-hour CI queues

50+ developers, dedicated teams per feature, CI scales horizontally

Build Times

32 minutes on CI (measured), svelte-check takes 16 minutes alone

8-12 minutes total for similar codebase, parallel type checking

API Performance

203 pods for 11k RPS proxy calls, 4.2s p95 response time

15-20 pods for same traffic, 180ms p95 response time

Server Customization

Write custom Vite plugins that break every update, no middleware

Express.js middleware patterns, ecosystem of battle-tested plugins

Testing

70% test pass rate due to SSR timing issues, 2,847 flaky tests

95%+ test reliability, standard Jest/Testing Library patterns work

Ecosystem

Port React components yourself (2 weeks per complex component)

50k+ packages, everything exists, copy-paste solutions from Stack Overflow

Learning Curve

18 months and still debugging framework issues instead of building features

React devs productive in 1-2 weeks, established patterns

Hiring

Posted senior role, got 3 Svelte candidates out of 200 applicants

Every frontend developer knows React, 10x larger talent pool

How to Make SvelteKit Work (If You Hate Yourself)

Some teams apparently make SvelteKit work at enterprise scale. I've seen like two examples and both involve rebuilding half the framework. If you're stuck with SvelteKit for political reasons, here's what you'll need to do.

Yahoo Finance: How They Actually Made It Work

Yahoo Finance runs on SvelteKit apparently. I've seen this mentioned in like every SvelteKit discussion as proof it can scale. Here's probably why it works for them:

Enterprise Architecture Diagram

They have money to throw at the problem. Yahoo can afford a team whose full-time job is making SvelteKit not suck. Most of us can't.

They kept APIs separate. Smart. They didn't try to use SvelteKit for backend work because they're not insane. Probably using Express or FastAPI for the heavy lifting.

They're probably running a pretty custom setup. When your whole business depends on it, you build whatever tooling you need. We don't have that luxury.

The Microfrontend Hack Everyone Builds

So your SvelteKit app is too big and your team is too big and everything is slow as hell. Time for microfrontends!

Except `vite-plugin-federation` doesn't work. Of course it doesn't. So you get to build your own system.

After a month of pain, we ended up with a dynamic import system that's basically just:

// The hacky solution every team builds
const loadApp = async (appName, target, props) => {
  const module = await import(`./apps/${appName}.js`);
  return new module.default({ target, props });
};

It works, sort of. We can deploy parts separately now. But we spent weeks on dependency sharing and it still breaks randomly. Webpack solved this years ago but here we are reinventing everything.

Server Middleware Hell

Normal frameworks have middleware. SvelteKit has "write your own Vite plugin and pray it doesn't break."

Need auth middleware? Custom Vite plugin. Want tracing? Another custom plugin. Security headers? You guessed it.

We've written like 6 different Vite plugins at this point. Half of them break every time we update SvelteKit. The other half work in development but fail silently in production.

// Every enterprise team writes this eventually
const hackyMiddleware = {
  name: 'our-custom-middleware',
  configureServer: (vite) => {
    // Works in dev
    vite.middlewares.use(ourMiddleware);
  },
  configurePreviewServer: (server) => {
    // Breaks in production
    server.middlewares.use(ourMiddleware);
  }
};

It's embarrassing how much time we've spent on this. Express lets you add middleware in one line.

Rolldown: The "Fix" That Broke Everything Else

Everyone was excited about Rolldown in Vite 7. "Finally," we thought, "maybe builds won't take 30 minutes."

Well, I tried it. Builds got 18% faster (27 minutes down to 22 minutes - whoopee) but now they need 8GB+ of heap or they crash with <--- Last few GCs ---> [87261:0x148008000] Fatal error in , line 0 API fatal error handler returned after process out of memory. And half our dependencies don't work because Rolldown is pickier about exports - kept getting Error: Failed to resolve entry for package "some-package" for packages that worked fine with Rollup.

The bundle got bigger too - jumped from 2.8MB to 3.1MB gzipped. Just perfect. So we trade build time for bundle size, memory usage, and package compatibility. Classic optimization.

I spent a week debugging npm package compatibility issues instead of building features - packages like @microsoft/signalr and chart.js just don't export correctly for Rolldown. It's 2025 and I'm debugging JavaScript module exports instead of shipping user-facing features. How is this progress?

How to Test SvelteKit Without Losing Your Mind

Testing SvelteKit is a nightmare but we've figured out some workarounds.

Mock at the service layer, not the HTTP layer. SvelteKit's SSR does weird shit that breaks normal request mocking. We mock our business logic instead:

// This actually works
vi.mock('$lib/services/api', () => ({
  fetchUserData: vi.fn(() => Promise.resolve(mockData)),
}));

Wait for hydration or your tests will be flaky forever:

// Every Playwright test needs this
await page.waitForSelector('[data-kit-started]', { timeout: 15000 });

Test components in isolation when possible. Full page tests with SSR are unreliable:

// Simpler and more reliable
import { render } from '@testing-library/svelte';
import MyComponent from './MyComponent.svelte';

Even with these hacks, maybe 70% of our tests pass consistently. The rest are flaky because of timing issues.

Team Survival Strategies

Development Team Collaboration

If you're stuck with SvelteKit and multiple developers, here's what we learned the hard way:

Keep teams small. More than 10-12 people and you'll have merge conflicts constantly. The codebase structure just doesn't support large teams well.

Someone needs to own the tooling. We had to dedicate one developer basically full-time to keeping our build system working. That's overhead you probably can't afford.

Split the app early. Don't wait until it's huge. We should've gone microfrontends at 2,000 components, not 4,000. By then it's too painful to refactor.

Have a backup plan. We're already researching our Next.js migration because this isn't sustainable long-term.

Docker Deployment Hell Nobody Talks About

Our Docker builds randomly fail with Error: spawn ENOMEM on the same AWS EC2 instances that built our React app perfectly for 2 years. Tried every Node.js flag combination - --max-old-space-size=4096, --max-semi-space-size=256, even --optimize-for-size. Nothing worked consistently.

The killer: our npm ci step fails maybe 30% of the time with npm ERR! Cannot read property 'length' of undefined and no other context. Same Dockerfile, same package-lock.json, same base image. Just randomly fails and forces a rebuild. We're burning $400/month extra on build time because of this shit.

Had to add retry logic to our CI that rebuilds up to 3 times before giving up. Our deployment pipeline that took 8 minutes for React now takes 25-45 minutes depending on how many retries we need.

What Actually Works: Don't Go All-In

The smart teams I've seen don't bet everything on SvelteKit. They use it selectively:

Use SvelteKit for: Simple customer-facing stuff, marketing pages, basic dashboards. The things it's actually good at.

Use normal technology for: APIs (Express or whatever), background jobs, integrations with your actual enterprise systems, anything performance-critical.

We learned this the hard way. Should've kept our APIs separate from day one instead of trying to do everything in SvelteKit and then ripping it all out 8 months later when the performance became embarrassing.

The Future? Probably Just Use Something Else

There's always some new SvelteKit feature that's supposed to fix everything. Svelte 5 runes were gonna solve everything. Rolldown was gonna make builds fast. Now there's some async functions thing coming.

Maybe it'll help, maybe it won't. But I've been hearing "the next version will fix it" for a year now and my laptop still sounds like a jet engine when I open VS Code.

If you're starting a new project today, just use Next.js. Your future self will thank you when you need to hire developers or scale past 10 people or add any enterprise features.

Resources for When SvelteKit Breaks (And It Will)

Related Tools & Recommendations

compare
Similar content

Next.js, Nuxt, SvelteKit, Remix vs Gatsby: Enterprise Guide

18 months in Gatsby hell, 6 months testing everything else - here's what actually works for enterprise teams

Next.js
/compare/nextjs/nuxt/sveltekit/remix/gatsby/enterprise-team-scaling
100%
compare
Similar content

Remix vs SvelteKit vs Next.js: SSR Performance Showdown

I got paged at 3AM by apps built with all three of these. Here's which one made me want to quit programming.

Remix
/compare/remix/sveltekit/ssr-performance-showdown
69%
tool
Similar content

SvelteKit: Fast Web Apps & Why It Outperforms Alternatives

I'm tired of explaining to clients why their React checkout takes 5 seconds to load

SvelteKit
/tool/sveltekit/overview
59%
integration
Recommended

I Spent Two Weekends Getting Supabase Auth Working with Next.js 13+

Here's what actually works (and what will break your app)

Supabase
/integration/supabase-nextjs/server-side-auth-guide
39%
pricing
Recommended

What Enterprise Platform Pricing Actually Looks Like When the Sales Gloves Come Off

Vercel, Netlify, and Cloudflare Pages: The Real Costs Behind the Marketing Bullshit

Vercel
/pricing/vercel-netlify-cloudflare-enterprise-comparison/enterprise-cost-analysis
38%
pricing
Recommended

Got Hit With a $3k Vercel Bill Last Month: Real Platform Costs

These platforms will fuck your budget when you least expect it

Vercel
/pricing/vercel-vs-netlify-vs-cloudflare-pages/complete-pricing-breakdown
38%
tool
Similar content

SvelteKit Performance Optimization: Fix Slow Apps & Boost Speed

Users are bailing because your site loads like shit on mobile - here's what actually works

SvelteKit
/tool/sveltekit/performance-optimization
38%
integration
Recommended

Stop Your APIs From Breaking Every Time You Touch The Database

Prisma + tRPC + TypeScript: No More "It Works In Dev" Surprises

Prisma
/integration/prisma-trpc-typescript/full-stack-architecture
37%
review
Recommended

ESLint + Prettier Setup Review - The Hard Truth About JavaScript's Golden Couple

After 7 years of dominance, the cracks are showing

ESLint
/review/eslint-prettier-setup/performance-usability-review
35%
tool
Similar content

SvelteKit Auth Troubleshooting: Fix Session, Race Conditions, Production Failures

Debug auth that works locally but breaks in production, plus the shit nobody tells you about cookies and SSR

SvelteKit
/tool/sveltekit/authentication-troubleshooting
33%
tool
Similar content

SvelteKit Deployment Troubleshooting: Fix Build & 500 Errors

When your perfectly working local app turns into a production disaster

SvelteKit
/tool/sveltekit/deployment-troubleshooting
33%
pricing
Recommended

Backend Pricing Reality Check: Supabase vs Firebase vs AWS Amplify

Got burned by a Firebase bill that went from like $40 to $800+ after Reddit hug of death. Firebase real-time listeners leak memory if you don't unsubscribe prop

Supabase
/pricing/supabase-firebase-amplify-cost-comparison/comprehensive-pricing-breakdown
32%
tool
Similar content

npm Enterprise Troubleshooting: Fix Corporate IT & Dev Problems

Production failures, proxy hell, and the CI/CD problems that actually cost money

npm
/tool/npm/enterprise-troubleshooting
26%
tool
Similar content

Node.js Performance Optimization: Boost App Speed & Scale

Master Node.js performance optimization techniques. Learn to speed up your V8 engine, effectively use clustering & worker threads, and scale your applications e

Node.js
/tool/node.js/performance-optimization
25%
tool
Recommended

Next.js - React Without the Webpack Hell

competes with Next.js

Next.js
/tool/nextjs/overview
24%
tool
Similar content

Pulumi Cloud Enterprise Deployment: Production Reality & Security

When Infrastructure Meets Enterprise Reality

Pulumi Cloud
/tool/pulumi-cloud/enterprise-deployment-strategies
23%
tool
Similar content

Django: Python's Web Framework for Perfectionists

Build robust, scalable web applications rapidly with Python's most comprehensive framework

Django
/tool/django/overview
22%
compare
Recommended

I Tested Every Heroku Alternative So You Don't Have To

Vercel, Railway, Render, and Fly.io - Which one won't bankrupt you?

Vercel
/compare/vercel/railway/render/fly/deployment-platforms-comparison
22%
tool
Recommended

TypeScript - JavaScript That Catches Your Bugs

Microsoft's type system that catches bugs before they hit production

TypeScript
/tool/typescript/overview
22%
tool
Recommended

JavaScript to TypeScript Migration - Practical Troubleshooting Guide

This guide covers the shit that actually breaks during migration

TypeScript
/tool/typescript/migration-troubleshooting-guide
22%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization