kristiandupont/extract-pg-schema

Possible missing peer dependency issue knex/pg?

Closed this issue · 3 comments

I am not sure if I am missing something. I tried to quickly skim through old commits to understand. I ended up here because I am trying to use kanel in a yarn 2+ monorepo. Yarn 2+ will specifically break if you are using a package that does not install peer dependencies of its own dependencies. I get an error that knex does not have pg as a peer dep.

knex tried to access pg (a peer dependency) but it isn't provided by its ancestors;
this makes the require call ambiguous and unsound.

which gets followed by

Ancestor breaking the chain: extract-pg-schema@npm:3.1.5

I saw that some time back knex was removed as a devDep where it also had pg as a devDep, but now knex is a dependency and it also has a dependency on @types/pg and not pg itself.

I am curious if swapping @types/pg to devDependencies and pg to dependencies will fix this issue, but I don't quite have the time to build everything locally and test my repo using my versions of kanel and extract-pg-schema.

So please let me know if I am missing something and way off base and I will dive back into the rabbit-hole. Otherwise, this might be the fix?

TY 😄

That is a bug, nothing more and nothing less :-) I'll fix it!

Try now.

Works perfectly on yarn 2+ now, Thanks @kristiandupont!