Skip to content

Comments

fix: replace deprecated rmdirSync with rmSync#171

Open
adam2am wants to merge 1 commit intoblackboardsh:mainfrom
adam2am:fix/replace-deprecated-rmdirSync
Open

fix: replace deprecated rmdirSync with rmSync#171
adam2am wants to merge 1 commit intoblackboardsh:mainfrom
adam2am:fix/replace-deprecated-rmdirSync

Conversation

@adam2am
Copy link

@adam2am adam2am commented Feb 20, 2026

Hey! 👋
While building sveltekit+electrobun app I got hit by typescript from svelte-check with:

node_modules/electrobun/dist/api/bun/core/Updater.ts:148:26
Error: Expected 1 arguments, but got 2.
    rmdirSync(fullPath, { recursive: true });

Happens in 3 spots. So I decided to ship pr to update deprecated rmdirSync
Refs: DEP0147 | rmSync docs

Fix

Replace rmdirSync with rmSync - same signature, modern API.
Files:

  • package/src/bun/core/Updater.ts (4 changes)
  • package/src/cli/index.ts (5 changes)
    Your code already guards with statSync checks, so no force: true needed. Just a function name swap.
    Tested in my SvelteKit project, went from 3 errors to 0.

Replaces all occurrences of the deprecated rmdirSync API with the modern rmSync equivalent. This fixes TypeScript errors when using Bun's type checking with svelte-check.

Changes:
- package/src/bun/core/Updater.ts: 4 replacements (import + 3 usages)
- package/src/cli/index.ts: 5 replacements (import + 4 usages)

The rmdirSync API was deprecated in Node.js 14 in favor of rmSync.

Tested with svelte-check and confirmed 0 errors after applying this fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant