-
Notifications
You must be signed in to change notification settings - Fork 302
TypeError: Cannot read properties of undefined (reading 'replace') #923
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
Comments
So I edited the code manually and logged it.
And the value of EDIT: It's because Line 112 in f58cd4f
|
Running into this as well |
I'm also having this problem |
We are also seeing this error in our projects:
I am not convinced it is an issue with the initial query since /usr/src/app/node_modules/postgres/cjs/src/connection.js:383:14 points to Line 383 in a2c7de1
It is very problematic that we don't see the actual error. It does not happen on startup but when our NodeJS backend is under high load. |
I'm getting this error with |
If you are using Deno you can work around this by switching to my fork with: import postgres from "https://gitlab.com/soapbox-pub/postgres.js/-/raw/e79d7d2039446fbf7a37d4eca0d17e94a94b8b53/deno/mod.js"; I've been using this fork in a high workload application for 3 or 4 months now. It's just the patch applied from #944 If you're on Node, perhaps edit the file in |
Thanks @alexgleason |
Fixed in e8bb3b8 |
I am still getting the same error after updating to
The error above gets printed, and the app crashes. |
Thank you for the quick check @abdelfattahradwan Can you show some code that causes this? |
I have the following code in a export const psql = postgres({
host: env.DB_HOST,
port: Number.parseInt(env.DB_PORT, 10),
user: env.DB_USER,
password: env.POSTGRES_PASSWORD,
database: env.DB_NAME,
});
const dialect = new PostgresJSDialect({
postgres: psql,
});
export const kysely = new Kysely<Record<string, Record<string, unknown>>>({
dialect,
}); And upon starting my app, I run the following query: export async function getRecurringPayments(
options: typeof GetRecurringPaymentsOptionsSchema.infer,
) {
let query = kysely
.selectFrom("public.recurring_payments_view")
.select([
"public.recurring_payments_view.uuid",
"public.recurring_payments_view.name",
"public.recurring_payments_view.description",
"public.recurring_payments_view.start_date",
"public.recurring_payments_view.frequency",
"public.recurring_payments_view.next_charge_date",
"public.recurring_payments_view.days_until_next_charge",
"public.recurring_payments_view.normalized_days_until_next_charge",
"public.recurring_payments_view.cost",
"public.recurring_payments_view.currency",
"public.recurring_payments_view.effective_local_cost",
"public.recurring_payments_view.is_active",
"public.recurring_payments_view.payment_type",
"public.recurring_payments_view.apply_foreign_exchange_markup",
]);
if (options.sortBy) {
query = query.orderBy(options.sortBy, options.sortingOrder ?? "asc");
}
const rows = await query.execute();
return GetRecurringPaymentsResultSchema.assert(rows);
} Once that (or any other query is executed) the error is printed and app the crashes 🫠 |
Perfect ! I can reproduce here now - looking into it |
@porsager I just tested |
Thanks for the help on this @abdelfattahradwan .. fixed and released ;) |
I'm getting some kind of error, but the error handler itself has an error, so I'm not sure what the error is. 😃
The text was updated successfully, but these errors were encountered: