Abhishek
Abhishek7mo ago

date-fns-tz support ?

I have util function which uses date-fns-tz or date-fns library which is called inside a mutation does convex not support this lib ? as im getting this error
Uncaught Error: `new Date()` with non-number arguments is not supported.
at getDateTimeFormat (../../node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js:64:6)
at tzTokenizeDate (../../node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js:6:13)
at calcOffset (../../node_modules/date-fns-tz/esm/_lib/tzParseTimezone/index.js:88:14)
at tzParseTimezone (../../node_modules/date-fns-tz/esm/_lib/tzParseTimezone/index.js:64:8)
at zonedTimeToUtc (../../node_modules/date-fns-tz/esm/zonedTimeToUtc/index.js:51:24)
at checkIfCampaignIsInPast (../../convex/utils.ts:12:6)
at handler (../convex/linkedin.ts:62:48)
Uncaught Error: `new Date()` with non-number arguments is not supported.
at getDateTimeFormat (../../node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js:64:6)
at tzTokenizeDate (../../node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js:6:13)
at calcOffset (../../node_modules/date-fns-tz/esm/_lib/tzParseTimezone/index.js:88:14)
at tzParseTimezone (../../node_modules/date-fns-tz/esm/_lib/tzParseTimezone/index.js:64:8)
at zonedTimeToUtc (../../node_modules/date-fns-tz/esm/zonedTimeToUtc/index.js:51:24)
at checkIfCampaignIsInPast (../../convex/utils.ts:12:6)
at handler (../convex/linkedin.ts:62:48)
The same util function is working fine in the frontend of nextjs
2 Replies

Did you find this page helpful?