drizzle-team / drizzle-kit-mirror

Docs and issues repository for drizzle-kit
291 stars 17 forks source link

npx/bunx drizzle-kit generate SyntaxError: Unexpected token '?' #267

Open theodufort opened 9 months ago

theodufort commented 9 months ago

Im trying to generate an sqlite DB from a schema i created.

Environement:

What i tried:

The error i get for the 4 of those:

/media/disk1/Clones/bunjs-rest-api/app-api/node_modules/drizzle-kit/bin.cjs:4692 return${idx.name};${idx.columns.join(",")};${idx.isUnique};${idx.using ?? ""};${idx.algorithm ?? ""};${idx.lock ?? ""}`; ^

SyntaxError: Unexpected token '?' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47 `

EDIT: For anyone experiencing weird issues when switching or playing with bun,node or npm. Try this tag when using any package --bun like bunx --bun drizzle-kit generate:sqlite --schema ./db/schema.ts

wiredmatt commented 8 months ago

Lifesaver! bunx --bun did the trick.

monstajoe2002 commented 2 months ago

I have the same problem here: SyntaxError: Unexpected token '<' I'm using pnpm by the way

theodufort commented 1 month ago

For anyone experiencing weird issues when switching or playing with bun,node or npm. Try this tag when using any package --bun like bunx --bun drizzle-kit generate:sqlite --schema ./db/schema.ts