You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple test script in a Deno environment:
import{createPool,typeDatabaseConnection,}from"slonik";asyncfunctionrun(){constconnectionString=Deno.env.get("DB_URL")??"";constpool=awaitcreatePool(connectionString);returnpool.connect(async(connection: DatabaseConnection)=>{constresult=awaitconnection.one(sql.unsafe`SELECT 1 as id`);console.log(result);returnresult;});}run();
error: Uncaught Error: Could not find module root given file: "https://www.esm.sh/v132/[email protected]/deno/bindings.mjs". Do you have a `package.json` file?
error: Module not found "https://deno.land/std/node/crypto.ts".
at https://cdn.skypack.dev/-/[email protected]/dist=es2019,mode=imports/optimized/pg.js:2:8
Desired Behavior
I have a simple test script in a Deno environment:
Though, instead of
from "slonik"
, I have to use a URL: https://deno.land/[email protected]/basics/modulesI tried using a couple CDNs that will supposedly convert CommonJS code to ESM for you to no avail:
https://esm.sh/slonik
https://cdn.skypack.dev/slonik
Motivation
Knex has a couple similar issues:
Implementation
Some notes on migrating from Node to Deno: https://deno.land/[email protected]/node/migrate
Requires #484 to be done. A tool like https://github.com/garronej/denoify might be usable.
The text was updated successfully, but these errors were encountered: