Darvesh
Darvesh9mo ago

`deno run` ignores @deno-types?

Uncaught SyntaxError: The requested module 'pg' does not provide an export named 'Pool'
import { Pool } from "pg";
Uncaught SyntaxError: The requested module 'pg' does not provide an export named 'Pool'
import { Pool } from "pg";
I get the above error for the below line
// @deno-types="npm:@types/pg"
import { Pool } from "pg";
// @deno-types="npm:@types/pg"
import { Pool } from "pg";
I have this in my import map
"pg": "npm:pg@8.11.3",
"pg": "npm:pg@8.11.3",
deno 1.37.2 (release, aarch64-apple-darwin)
1 Reply
Darvesh
Darvesh9mo ago
// @deno-types="npm:@types/pg"
import pg from "pg";

const Pool = pg.Pool;
// @deno-types="npm:@types/pg"
import pg from "pg";

const Pool = pg.Pool;
Fixed it, thanks.