TryGhost / node-sqlite3

SQLite3 bindings for Node.js
BSD 3-Clause "New" or "Revised" License
6.23k stars 817 forks source link

Running Sequelize on Bun using sqlite3 produces undefined symbol: uv_close error #1769

Open jerrywoo96 opened 8 months ago

jerrywoo96 commented 8 months ago

Issue Summary

Node.js has no errors, but since being introduced to me that Bun has up to 2x better improvement in performance when running Express.js apps, i've decided to give Bun a try.

Running Sequelize using the sqlite3 driver produces this error:

TypeError: /nodejs/app/node_modules/sqlite3/build/Release/node_sqlite3.node: undefined symbol: uv_close
      at bindings (/nodejs/app/node_modules/bindings/bindings.js:112:48)
      at /nodejs/app/node_modules/sqlite3/lib/sqlite3-binding.js:1:8
      at /nodejs/app/node_modules/sqlite3/lib/sqlite3.js:2:7
      at _loadDialectModule (/nodejs/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:49:14)
      at new ConnectionManager (/nodejs/app/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:18:16)
      at new SqliteDialect (/nodejs/app/node_modules/sequelize/lib/dialects/sqlite/index.js:13:30)
      at new Sequelize (/nodejs/app/node_modules/sequelize/lib/sequelize.js:194:20)
      at /nodejs/app/utils/db.js:8:26

Line 8 in my db.js contains the following:

import { DataTypes, Op, Sequelize, col, fn, where } from 'sequelize';

export const SessionDb = new Sequelize({
  logging: false,
  dialect: 'sqlite',
  storage: dbList.Session
});

Steps to Reproduce

export const SessionDb = new Sequelize({ logging: false, dialect: 'sqlite', storage: dbList.Session });

Version

5.1.7

Node.js Version

Bun v1.0.30 (Not Node.js) on Alpine docker image container

How did you install the library?

npm -i sqlite3

Jarred-Sumner commented 8 months ago

This is a bug in Bun

damms005 commented 6 days ago

@Jarred-Sumner Please can you link to an open issue that tracks the issue in Bun where we can monitor progress, or should be created?

jerrywoo96 commented 6 days ago

@Jarred-Sumner Please can you link to an open issue that tracks the issue in Bun where we can monitor progress, or should be created?

@damms005 https://github.com/oven-sh/bun/issues/4290#issue-1864670978