#Binding Error

1 messages · Page 1 of 1 (latest)

fluid abyss
#

Hi, I am using sqlite3 in my ts Nodejs project, I am getting the bindings error for trigger.dev,
The package is "sqlite3": "^5.1.7",
"@types/sqlite3": "^3.1.11",
I have checked online, binding error is a common problem on servers while using sqlite3, and the general solutions are the rm the node modules and install again, npm i bindings.
I have tried these but the trigger.dev when run locally is throwing this error.
Error: Could not locate the bindings file. Tried: .....

Any ideas?

atomic barn
#

The first I would try is adding it external:

export default defineConfig({
  //...your other settings
  build: { external: ['sqlite3'] }
});
#

That's the trigger.config file

fluid abyss
#

Thanks, it worked.🙌

atomic barn
#

Ah fantastic

#

Out of interest, what are you doing with sqlite? Where is the database file stored?

fluid abyss
#

I am basically creating a import your files from a specific website, the site stores the data in sqlite db, so user can upload that files and their existing records will be added to our site. I am using triggers to process the files once it's in our db. I am fetching it and pushing the records to our tables.

atomic barn
#

You download the sqlite db file, push records, the upload it back to where it was? Or are you using something like Turso for sqlite?