erquhart
erquhart14mo ago

Some URL methods not supported in convex runtime

I'm using normalize-url, which works both in Node and the web - it looks like some of the web URL api isn't supported. I have a number of places to normalize url inputs and pushing that through an action is going to be pretty loopy. Curious if support is in the cards.
Not implemented: set username for URL. Consider calling an action defined in Node.js instead (https://docs.convex.dev/functions/actions).
Not implemented: set username for URL. Consider calling an action defined in Node.js instead (https://docs.convex.dev/functions/actions).
The offending library code:
const urlObject = new URL(urlString);
urlObject.username = ''
const urlObject = new URL(urlString);
urlObject.username = ''
5 Replies
erquhart
erquhartOP14mo ago
Hmm I bet you're not fully supporting URL to keep the runtime light
ian
ian14mo ago
We can see how much effor this would take
ballingt
ballingt14mo ago
"to keep the runtime light" is a most generous way to put this, thank you @erquhart  — there's some truth to that but mostly we haven't gotten around to it, since https://www.npmjs.com/package/normalize-url is huge we should add support for this.
npm
normalize-url
Normalize a URL. Latest version: 8.0.0, last published: a year ago. Start using normalize-url in your project by running npm i normalize-url. There are 1307 other projects in the npm registry using normalize-url.
ballingt
ballingt14mo ago
actually just hitting that error automatically logs it as "someone tried to use this API, tally it torwards us implementing it"
erquhart
erquhartOP14mo ago
Nice, thanks for the context! I'll limit my use to client side for now

Did you find this page helpful?