Xstoudi / pino-pg

A Pino Transport for PostgreSQL databases.
MIT License
8 stars 3 forks source link

SyntaxError: Unexpected token in JSON at position 0 #153

Open ShivamJoker opened 3 years ago

ShivamJoker commented 3 years ago

I am getting this while using it with esm package

$ nodemon -r esm -e yaml,js,json index | pino-pg --connectionUrl postgres://xxx:xxx@host.com:5432/easycollab --table test.logs --column log

SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at /Users/shivam/real-dev/easy-collab-api/node_modules/pino-pg/dist/src/index.js:36:100
    at Generator.next (<anonymous>)
    at resume (/Users/shivam/real-dev/easy-collab-api/node_modules/pino-pg/dist/src/index.js:15:44)
    at fulfill (/Users/shivam/real-dev/easy-collab-api/node_modules/pino-pg/dist/src/index.js:17:31)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
Xstoudi commented 3 years ago

First, thanks for the report! I'll be unable to address this until 1st of July. You can submit a PR if you need it sooner.