Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
enix90s opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@enix90s
Copy link

enix90s commented May 10, 2024

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:

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)
// 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

@enix90s enix90s added the bug Something isn't working label May 10, 2024
@enix90s enix90s changed the title [BUG]: TypeError: undefined is not an object (evaluating 'rawTable[InlineForeignKeys3].push') [BUG]: Bun: TypeError: undefined is not an object (evaluating 'rawTable[InlineForeignKeys3].push') May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant