drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.54k stars 643 forks source link

[BUG]: Unable to use `push` or `studio` #3113

Closed statusunknown418 closed 3 weeks ago

statusunknown418 commented 1 month ago

What version of drizzle-orm are you using?

0.33.0

What version of drizzle-kit are you using?

0.24.2

Describe the Bug

Haven't even updated any of the packages but started getting this errors when trying to do drizzle-kit push or drizzle-kit studio

➜ pnpm db:studio

> nfc-portal@0.1.0 db:studio /Users/a3tech/Developer/personal_projects/nfc-portal
> drizzle-kit studio --port=5555

No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/a3tech/Developer/personal_projects/nfc-portal/drizzle.config.ts'
Error: Transform failed with 1 error:
/Users/a3tech/Developer/personal_projects/nfc-portal/src/lib/utils.tsx:276:26: ERROR: Expected ">" but found "{"
    at failureErrorWithLog (/Users/a3tech/Developer/personal_projects/nfc-portal/node_modules/.pnpm/esbuild@0.19.12/node_modules/esbuild/lib/main.js:1651:15)
    at /Users/a3tech/Developer/personal_projects/nfc-portal/node_modules/.pnpm/esbuild@0.19.12/node_modules/esbuild/lib/main.js:849:29
    at responseCallbacks.<computed> (/Users/a3tech/Developer/personal_projects/nfc-portal/node_modules/.pnpm/esbuild@0.19.12/node_modules/esbuild/lib/main.js:704:9)
    at handleIncomingPacket (/Users/a3tech/Developer/personal_projects/nfc-portal/node_modules/.pnpm/esbuild@0.19.12/node_modules/esbuild/lib/main.js:764:9)
    at Socket.readFromStdout (/Users/a3tech/Developer/personal_projects/nfc-portal/node_modules/.pnpm/esbuild@0.19.12/node_modules/esbuild/lib/main.js:680:7)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: [Object],
      notes: [],
      pluginName: '',
      text: 'Expected ">" but found "{"'
    }
  ],
  warnings: []
}

this is my config file

import { type Config } from "drizzle-kit";

import { env } from "~/env";

export default {
  schema: "./src/server/db/schema.ts",
  dialect: "sqlite",
  driver: "turso",
  verbose: true,
  dbCredentials: {
    url: env.DATABASE_URL,
    authToken: env.AUTH_TOKEN,
  },
} satisfies Config;

Expected behavior

well it should work as before

Environment & setup

No response

L-Mario564 commented 3 weeks ago

Could you provide steps to reproduce this bug?

statusunknown418 commented 3 weeks ago

@L-Mario564 forgot to close this, the error was due to using .tsx instead of ts in a file that was used by drizzle