Trouble committing file to GitHub but only in bun runtime
I'm trying to create a script to commit font files into my github repository. This is code that is migrated over from airplane.dev. Initially i created the code using the Deno runtime, this works but I want to use fontkit, which does not support the "import ... from ..." imports.
So the following code WORKS:
18 Replies
So then I tried to create it using Bun but got a strange error from GitHub. Running the code locally with Bun it does work which makes it even stranger to me. Here i can use the fontkit package:
Code that does not work, running on windmill.dev Bun runtime:
and then the simplified code, running locally, that does work:
Things i've tried:
hardcoding the github token. that made no difference.
not using the uploaded file but just uploading a string of text. Also same issue. And uploading a string of text locally does work.
What can I do to try and diagnose this issue? really stumped by this...
and the error I get is an html error from GitHub, not showing any information. Just saying there is an issue and it has been reported. Makes me thing that something is messed up with the import of Octokit package perhaps?
What is the error that you see?
Github just throws me a 500 error with a generic error message, sadly not much of use:
But the thing that is confusing to me is that in the deno runtime, or locally with Bun, this same request works...
are you self-hosting?
no, using Cloud
you should try if it works self-hosting
then it's just a network difference
Maybe a request to GitHub is blocked from your guy's servers or something?
Will give self hosted a try and report back
Also does not work on self hosted, same 500 error on that request.
just running the project through docker with docker-compose
can you console log the args of the request, local vs windmill
Okay i was able to narrow down the issue to one line of code:
inside this request:
if i use the hardcoded path the request works, but if i use the string with template literals it doesn't work, am i missing something obvious here?
complete script for context:
Would recommend using console log to see what differs
i did, they are identical.
see the message from 4:33
okay im pretty sure template literals inside an object are broken in the Bun runtime on Windmill.
This line of code:
Shows me this output:
running it in bun locally, not through Windmill, it does work:
this file:
Gives me this output:
hmm i think it has to do with the encoding of that string. the fontName does have a typeof of string, but i think it's incorrect utf maybe? The string is read from a otf font file.
Just logging the name works but when i place it inside an object it shows all those characters.
Where is that fontname read from
Ok it's read from a file in input
Could you send the file here
okay I now see that this is not an issue with Windmill, I also got this same result running it locally in bun. Something is messed up with the string when using fontkit to read the font name from the file.
👍
there is very little transformation in windmill on purpose so that issue would have been very weird
Sorry about that, will have to see if I can solve this myself!
Just one more question, is it possible to get the name and extension of an uploaded file in windmill?
im just uploading it like this:
but I believe that just gives you the base64 string, not the filename and extension right?
yes with the s3 integration
but not with base64
see docs about file handling
👍