Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Error with postgresjs library #827

Closed
abdulrahman1s opened this issue Jul 17, 2024 · 0 comments · Fixed by #828
Closed

Syntax Error with postgresjs library #827

abdulrahman1s opened this issue Jul 17, 2024 · 0 comments · Fixed by #828

Comments

@abdulrahman1s
Copy link

Description:

The latest release has caused an issue with the postgres.js library.

Steps to reproduce:

  1. Import the postgres npm package in the script being executed.
  2. Run node --import @swc-node/register/esm-register script.ts

Environment:

  • Node.js version: v20.11.1
  • OS: Nixos

Error log:

node:internal/process/esm_loader:34
      internalBinding('errors').triggerUncaughtException(
                                ^
[Error:   × Expected a semicolon
    ╭─[file:///home/user/github/project/node_modules/postgres/src/large.js:7:1]
  4 │   return new Promise(async(resolve, reject) => {
  5 │     await sql.begin(async sql => {
  6 │       let finish
  7 │       !oid && ([{ oid }] = await sql`select lo_creat(-1) as oid`)
    ·        ───
  8 │       const [{ fd }] = await sql`select lo_open(${ oid }, ${ mode }) as fd`
  9 │ 
 10 │       const lo = {
    ╰────


Caused by:
    Syntax Error] {
  code: 'GenericFailure'
}

Code snippet:

import postgres from 'postgres'

const sql = postgres()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant