hebertcisco/deploy-python-fastapi-in-vercel

I got a 500 internal error while doing a nd deploy

bobwatcherx opened this issue · 3 comments

i have cloned your project . and I want to know if it really works . but seems to get error error like this

root@minto-Lenovo-V145-14AST:/home/minto/belajar/colongan/deploy-python-fastapi-in-vercel# vercel dev
Vercel CLI 28.10.1
> Ready! Available at http://localhost:3000
> Building @vercel/python@latest:api/index.py
Installing required dependencies...
> Built @vercel/python@latest:api/index.py [1m]
using Asynchronous Server Gateway Interface (ASGI)
<class 'TypeError'>
TypeError: Object prototype may only be an Object or null: undefined
    at Function.setPrototypeOf (<anonymous>)
    at new LambdaError (/usr/local/lib/node_modules/vercel/dist/index.js:9679:16)
    at Lambda.<anonymous> (/usr/local/lib/node_modules/vercel/dist/index.js:9812:27)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/vercel/dist/index.js:9726:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
<class 'TypeError'>
TypeError: Object prototype may only be an Object or null: undefined
    at Function.setPrototypeOf (<anonymous>)
    at new LambdaError (/usr/local/lib/node_modules/vercel/dist/index.js:9679:16)
    at Lambda.<anonymous> (/usr/local/lib/node_modules/vercel/dist/index.js:9812:27)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/vercel/dist/index.js:9726:58)

and when running at local time it gets the same error too, what's the solution

You can try again, I tried to fix the vercel.json file, it was incongruent, it was build instead of builds.

image

Now you are deploying correctly, test it there.

Selection_001

i still got an error and cant deploy i will give my code

[GET] /
08:55:40:59

using Asynchronous Server Gateway Interface (ASGI)[ERROR] AttributeError: 'list' object has no attribute 'encode'Traceback (most recent call last):  File "/var/task/vc__handler__python.py", line 288, in vc_handler    'headers': [[k.lower().encode(), v.encode()] for k, v in headers.items()],  File "/var/task/vc__handler__python.py", line 288, in <listcomp>    'headers': [[k.lower().encode(), v.encode()] for k, v in headers.items()],

my code = https://github.com/bobwatcherx/fastapiFix

thanks

Try to change vercel's nodejs version to 18.x