kristiandupont/extract-pg-schema

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

moltar opened this issue · 3 comments

While upgrading from 4.2.4 to 4.3.1, running into this error on the code that works on the prior version.

Trying to trace it down, but so far no luck.

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

      at resolveSource (node_modules/.pnpm/extract-pg-schema@4.3.1/node_modules/extract-pg-schema/build/kinds/extractView.js:89:149)
      at map (node_modules/.pnpm/extract-pg-schema@4.3.1/node_modules/extract-pg-schema/build/kinds/extractView.js:122:28)
          at Array.map (<anonymous>)
      at call (node_modules/.pnpm/extract-pg-schema@4.3.1/node_modules/extract-pg-schema/build/kinds/extractView.js:121:45)
      at step (node_modules/.pnpm/extract-pg-schema@4.3.1/node_modules/extract-pg-schema/build/kinds/extractView.js:67:23)
      at Object.next (node_modules/.pnpm/extract-pg-schema@4.3.1/node_modules/extract-pg-schema/build/kinds/extractView.js:48:53)
      at fulfilled (node_modules/.pnpm/extract-pg-schema@4.3.1/node_modules/extract-pg-schema/build/kinds/extractView.js:39:58)

I think it's related to this:

const resolveSource = (
column: ViewColumn,
sourceMapping?: Record<string, ViewReference>,
): ViewColumn => ({
...column,
source: sourceMapping?.[column.name].source ?? null,
});

Looks like there's a question mark missing! I'll fix that.

It should be fixed now. Are you using Kanel or Schemalint?

It should be fixed now. Are you using Kanel or Schemalint?

Neither 😁

Just a homegrown script to snapshot tables and view structures to catch bugs in the data pipelines.

Thanks for fixing it quickly! ❤️