deploy_feedback icon indicating copy to clipboard operation
deploy_feedback copied to clipboard

deno sqlite error logs Deno.openSync is not function

Open bobwatcherx opened this issue 2 years ago • 5 comments

my half code :

import { Application,Router  } from "https://deno.land/x/oak/mod.ts";
import { DB } from "https://deno.land/x/sqlite/mod.ts";
import { oakCors } from "https://deno.land/x/cors/mod.ts";
const db = new DB("./datamain.sqlite"); > **error in here in my line logs**

my logs

TypeError: Deno.openSync is not a function at js_open (https://deno.land/x/[email protected]/build/vfs.js:27:24) at denoOpen (wasm://wasm/0028f022:1:2960) at sqlite3BtreeOpen (wasm://wasm/0028f022:1:148034) at openDatabase (wasm://wasm/0028f022:1:144000) at sqlite3_open_v2 (wasm://wasm/0028f022:1:149501) at open (wasm://wasm/0028f022:1:3771) at https://deno.land/x/[email protected]/src/db.ts:45:67 at setStr (https://deno.land/x/[email protected]/src/wasm.ts:13:24) at new DB (https://deno.land/x/[email protected]/src/db.ts:45:24) at file:///src/main.ts:4:12

bobwatcherx avatar Nov 27 '21 13:11 bobwatcherx

Deno.openSync is not supported in Deploy.

ry avatar Nov 27 '21 14:11 ry

Is there a support plan?

footearth avatar Apr 28 '22 06:04 footearth

Is there a support plan?

Currently there are no plans to support synchronous IO APIs

bartlomieju avatar Apr 28 '22 12:04 bartlomieju

Any way around this? I am also using deno-sqlite and am also running into this error.

EtienneK avatar Jul 15 '22 15:07 EtienneK

Any way around this?

FYI, I have created a library to address this issue: https://github.com/ayame113/mock-file

(I think this library is also useful for #118 and #173.)

ayame113 avatar Jul 23 '22 11:07 ayame113