drizzle-team / drizzle-team/drizzle-orm

[BUG]: Bun: TypeError: undefined is not an object (evaluating 'rawTable[InlineForeignKeys3].push')

Open
#2,289 5 comments 3 reactions 0 assignees View on GitHub
bug drizzle/kit priority
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### What version of `drizzle-orm` are you using?

0.30.10

### What version of `drizzle-kit` are you using?

_No response_

### Describe the Bug

Bun:: compiled file/exe:

```bash
19828 | sqliteTableBase = function(name2, columns3, extraConfig, schema3, baseName = name2) {
19829 | const rawTable = new SQLiteTable(name2, schema3, baseName);
19830 | const builtColumns = Object.fromEntries(Object.entries(columns3).map(([name22, colBuilderBase]) => {
19831 | const colBuilder = colBuilderBase;
19832 | const column10 = colBuilder.build(rawTable);
19833 | rawTable[InlineForeignKeys3].push(...colBuilder.buildForeignKeys(column10, rawTable));
^
TypeError: undefined is not an object (evaluating 'rawTable[InlineForeignKeys3].push')
at /$bunfs/root/quizzy:19833:7
at map (:1:21)
at sqliteTableBase (/$bunfs/root/quizzy:19830:45)
at /$bunfs/root/quizzy:26331:11
at /$bunfs/root/quizzy:47:71
at /$bunfs/root/quizzy:26361:3
at /$bunfs/root/quizzy:47:71
at /$bunfs/root/quizzy:27908:26

Bun v1.1.7 (Linux x64)
```
```js
// node_modules/drizzle-orm/sqlite-core/table.js
class SQLiteTable extends Table {
static [entityKind] = "SQLiteTable";
static Symbol = Object.assign({}, Table.Symbol, {
InlineForeignKeys: InlineForeignKeys3
});
[Table.Symbol.Columns];
[InlineForeignKeys3] = [];
[Table.Symbol.ExtraConfigBuilder] = undefined;
}
var sqliteTableBase, InlineForeignKeys3, sqliteTable;
var init_table4 = __esm(() => {
init_entity();
init_table();
sqliteTableBase = function(name2, columns3, extraConfig, schema3, baseName = name2) {
const rawTable = new SQLiteTable(name2, schema3, baseName);
const builtColumns = Object.fromEntries(Object.entries(columns3).map(([name22, colBuilderBase]) => {
const colBuilder = colBuilderBase;
const column10 = colBuilder.build(rawTable);
/** HERE... **/
rawTable[InlineForeignKeys3].push(...colBuilder.buildForeignKeys(column10, rawTable));
return [name22, column10];
}));
const table17 = Object.assign(rawTable, builtColumns);
table17[Table.Symbol.Columns] = builtColumns;
if (extraConfig) {
table17[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig;
}
return table17;
};
InlineForeignKeys3 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
sqliteTable = (name2, columns3, extraConfig) => {
return sqliteTableBase(name2, columns3, extraConfig);
};
});

```

### Expected behavior

_No response_

### Environment & setup

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.