-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
TypeError: populatorMap[pgType.kind] is not a function #417
Comments
Hi @magick93, did this happen after an upgrade (I just made some changes today), or is this the first time you are running Kanel? |
This is a fresh install, and my first time using kanel. I tried downgrading to v3.3.1, however I got the same error. |
I did notice that, even though I've downgraded, the error is still mentioning extract-pg-schema: 4.2.1 - which has only recently been released. |
I see. Well, it's a bit hard to debug without your database. Can you try to insert a console.log statement above the error (in the node_modules/extract-pg-schema/build/extractSchemas.js directly? (Or is that not possible with pnpm, which I haven't tried using?) |
Good idea. I made the following modification:
See https://gist.github.com/magick93/e2dd7499b0868dcea49c58cb42563252 It seems everything in the public schema is fine, but schemas created by extensions, such as Supabase Vault, and Supabase FDW is causing problems. Is it possible to specific a schema, or exclude schemas? |
I see. That is interesting, it should still be fixed. But yes, you can specify which schemas to include with the schemas config key. |
I'm not sure if this is related. I tried adding
|
That is unrelated. Is the non-public schema the one causing errors before? I don't think I've tried referencing schemas that aren't included, though that should probably be an option.. |
I am sorry I dropped the ball on this. Did you ever figure it out? It seems that |
Hi @kristiandupont No, I didnt manage to resolve this. |
It appears that everything in the |
These are foreign tables. |
That explains it. So, would you like types out of those, or would you like them ignored? |
It's been a while since I looked into this, but from memory this scheme wasn't used. I thought the issue was extension types and their respective installation scheme.
Ignoring is probably easiest and would be fine for me. |
I'm not sure if this is related. When I specify to use However, when I a schema that is not referencing any foreign tables, I get the following:
|
Ok, I've got a bit further in understanding the problem. With the following: return [4 /*yield*/, Promise.all(typesToExtract.map(function (pgType) { return __awaiter(_this, void 0, void 0, function () {
var result, error_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, populatorMap[pgType.kind](db, pgType)];
case 1:
result = _a.sent();
(_a = options === null || options === void 0 ? void 0 : options.onProgress) === null || _a === void 0 ? void 0 : _a.call(options);
return [2 /*return*/, result];
case 2:
error_1 = _a.sent();
console.error(`Error processing type ${pgType.kind}:`, error_1);
console.error('pgType:', pgType);
// You can add more logging or error handling here as needed
return [3 /*break*/, 3];
case 3: return [2 /*return*/];
}
});
}); }))]; I get:
The only references I can find to this are: create foreign table stripe.payment_intents (
id text,
customer text,
amount bigint,
currency text,
payment_method text,
created timestamp,
attrs jsonb
)
server stripe_server
options (
object 'payment_intents'
); |
Right, so foreign tables are not yet supported. I do mean to add support for them, but I can't guarantee when. If you can live with it for now, I think you should filter them out. |
Yes, no problem. |
Hello
I'm getting the following error when I try to run kanel:
The text was updated successfully, but these errors were encountered: