On Cloudflare d1, when I use the execute command, the table creation works when remote, but when loc

On Cloudflare d1, when I use the execute command, the table creation works when remote, but when local, I get an EOF error.

  • wrangler version: 3.109.1 (install by bun)
  • schema.sql
    CREATE TABLE IF NOT EXISTS articles (
     id INTEGER PRIMARY KEY AUTOINCREMENT,
     title TEXT,
     body TEXT,
     created_at TEXT DEFAULT CURRENT_TIMESTAMP,
     updated_at TEXT DEFAULT CURRENT_TIMESTAMP
    )
  • wrangler.jsonc
    {
     "name": "test-for-d1",
     "compatibility_date": "2025-2-18",
     "compatibility_flags": ["nodejs_compat"],
     "pages_build_output_dir": ".vercel/output/static",
     "d1_databases": [
      {
       "bindings": "DB",
       "database_name": test-d1",
       "database_id": "my database id here"
      }
     ]
    }
  • run command: wrangler d1 execute test-d1 --local --file=schema.sql (EOF ERROR)
  • run command2: wrangler d1 execute test-d1 --remote --file=schema.sql (SUCCESS)
  • what I tried: wrangler reinstall, bun cache ckear,
Also, I found wrangler can't start local server with EOF error.
Was this page helpful?