Has someone used https://jsr.io/@astral/astral successfully with edge functions?
I would like to implement an edge function, which should take HTML, width and height for the viewport, and create a screenshot after rendering the HTML on a browser.
My current Python code doing this work with Playwright:
I tried doing so with astral, but ran into several issues, first of all with the sync writing of files which does not seem to be working on edge functions. Found no way to configure it in a way it does async writes.
Also happy to use a different library if it's easier to get done this way.
Thx for your input!
1 Reply
I don't know about the usage of this library and I have my doubts that a browser will be able to run in edge function but the return type of screenshot is Uint8Array. You can convert it to a blob and upload it to supabase storage. I tried this in a sandbox and blob is uploaded to suapbase storage