kysely-org / kysely-ctl

Command-line tool for Kysely
MIT License
89 stars 4 forks source link

Cannot find module 'bun:sqlite' #67

Closed jkonowitch closed 3 months ago

jkonowitch commented 3 months ago

Reproduction Steps:

Clone this repository, and cd into the examples/bun folder. Attempt to run bun kysely migrate:latest.

Receive Error:

 ERROR  Cannot find module 'bun:sqlite'
Require stack:
- /kysely-ctl/examples/bun/.config/kysely.config.ts

  Require stack:
  - .config/kysely.config.ts
  at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
  at Function.resolve (node:internal/modules/helpers:190:19)
  at _resolve (node_modules/jiti/dist/jiti.js:1:241814)
  at jiti (node_modules/jiti/dist/jiti.js:1:244531)
  at .config/kysely.config.ts:3:18
  at evalModule (node_modules/jiti/dist/jiti.js:1:247313)
  at Object.jiti (node_modules/jiti/dist/jiti.js:1:245241)
  at resolveConfig (node_modules/c12/dist/shared/c12.cab0c9da.mjs:345:26)
  at loadConfig (node_modules/c12/dist/shared/c12.cab0c9da.mjs:147:29)
  at async getConfig (node_modules/kysely-ctl/dist/bin.js:215:24)
  at async getConfigOrFail (node_modules/kysely-ctl/dist/bin.js:247:18)
  at async usingMigrator (node_modules/kysely-ctl/dist/bin.js:470:18)
  at async Object.run (node_modules/kysely-ctl/dist/bin.js:540:5)
  at async runCommand (node_modules/citty/dist/index.mjs:316:16)
  at async runCommand (node_modules/citty/dist/index.mjs:307:11)
  at async runMain (node_modules/citty/dist/index.mjs:445:7)
  at async Object.parse (node_modules/kysely-ctl/dist/bin.js:960:7)

 ERROR  Cannot find module 'bun:sqlite'
igalklebanov commented 3 months ago

Hey 👋

Try bun --bun kysely migrate:latest instead.

jkonowitch commented 3 months ago

Ah - that did it! Thanks so much. Leaving this doc link here for anyone else who might stumble here: https://bun.sh/docs/cli/run#bun