TypeError: Cannot read properties of undefined (reading 'referencedTable')

C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\relations.ts:571
        const referencedTableTsName = tableNamesMap[getTableUniqueName(relation.referencedTable)];
                                                                         ^
TypeError: Cannot read properties of undefined (reading 'referencedTable')
    at normalizeRelation (C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\relations.ts:571:74)
    at SQLiteAsyncDialect.buildRelationalQuery (C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\sqlite-core\dialect.ts:673:32)
    at QueryPromise._toSQL (C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\sqlite-core\query-builders\query.ts:169:30)
    at QueryPromise._prepare (C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\sqlite-core\query-builders\query.ts:145:38)
    at QueryPromise.executeRaw (C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\sqlite-core\query-builders\query.ts:193:15)
    at QueryPromise.execute (C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\sqlite-core\query-builders\query.ts:197:15)
    at QueryPromise.then (C:\Users\Wiktor\WebstormProjects\verzio\node_modules\src\query-promise.ts:31:15)


This exception was thrown after using

  const builder = await db.query.files.findMany({
    with: {
      versions: true
    }
  })
Was this page helpful?