cloudflare / python-workers-examples

Apache License 2.0
98 stars 18 forks source link

FastAPI Example: TypeError: response.body.arrayBuffer is not a function #6

Open TheBitmonkey opened 4 months ago

TheBitmonkey commented 4 months ago

I am getting this error on the fastapi example:

Starting local server... [wrangler:inf] Ready on http://127.0.0.1:8787 Loading fastapi, starlette, anyio, sniffio, openssl, pydantic, typing-extensions, pydantic-core, annotated-types X [ERROR] Error in makeHandler

X [ERROR] Uncaught (in promise) TypeError: response.body.arrayBuffer is not a function

  at loadBundle (pyodide-internal:loadPackage:36:36)

I can't figure it out at all. Maybe import asgi does not work anymore?

jcrreis commented 4 months ago

have the same error

koast18 commented 4 months ago

same error, it seems something changes breaks that. simply downgrade is a workaround.

npm install wrangler@3.55.0

hoodmane commented 4 months ago

Thanks for the report @TheBitmonkey! I'll look into this as soon as I have a moment.

laike9m commented 3 months ago

Any update?

garrettgu10 commented 3 months ago

@laike9m a fix is out, i'm going to try to update wrangler tomorrow. Thanks for your patience!

mikenomitch commented 3 months ago

Hey all, a fix for this specific issue is technically out, but FastAPI is still failing due to another issue.

We're currently working on the broader issue, but probably won't have a new version of wrangler out with the fix until next week. Sorry about this :( We are also updating the gaps in automated testing that allowed us to miss this in the first place.

For the time being, if you downgrade to wrangler 3.55.0, you can get FastAPI working. Hopefully this workaround is only needed until next week.