import { PostgresError } from "postgres" - build error?

I'm getting build error when i try to import PostgresError from postgres It says The requested module 'postgres' does not provide an export named 'PostgresError' during build but I am getting no typescript error on my code. I have code like this
try {...}
catch (e) {
if (e instanceof PostgresError && e.code === '23505') {
return setError(form, '', 'Email already in use.');
}
return setError(form, '', 'Server error, please try again later.');
}
try {...}
catch (e) {
if (e instanceof PostgresError && e.code === '23505') {
return setError(form, '', 'Email already in use.');
}
return setError(form, '', 'Server error, please try again later.');
}
No description
2 Replies
the25
the2513mo ago
try to import postgres instead
import postgres from 'postgres'

...
if (error instanceof postgres.PostgresError) ...
import postgres from 'postgres'

...
if (error instanceof postgres.PostgresError) ...
sik
sikOP13mo ago
yeah figured it out later
Want results from more Discord servers?
Add your server