Brooooooklyn / canvas

High performance skia binding to Node.js. Zero system dependencies and pure npm packages without any postinstall scripts nor node-gyp.
https://vercel.skia.rs
MIT License
1.72k stars 73 forks source link

Error StringExpected #445

Open ARR4NN opened 2 years ago

ARR4NN commented 2 years ago

when i use the code on the npm page to create the house I get

Error
    at createCanvas (C:\Users\User\Documents\Discord Bots\Suggestions\node_modules\@napi-rs\canvas\index.js:160:7)
    at Object.execute (C:\Users\User\Documents\Discord Bots\Suggestions\commands\user commands\profile.js:24:24)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 'StringExpected'
}

the line 24 in profile.js is const canvas = createCanvas(300, 320)

twlite commented 2 years ago

is it possible to make these errors more meaningful? Right now it's hard to debug what exactly went wrong because most of the errors are like

Error ...
    code: '<SomeType>Expected'

We have to depend upon the line number in the stacktrace

Brooooooklyn commented 2 years ago

I'll improve the error messages in NAPI-RS

janpio commented 1 year ago

Related on Prisma side: https://github.com/prisma/prisma/issues/13864