hello, im trying to setup fastapi with cache support in vercel but i get this error
[ERROR] AssertionError: You must call init first!
Traceback (most recent call last):
File "/var/task/vchandlerpython.py", line 305, in vc_handler
response = asgi_cycle(vc_module.app, body)
File "/var/task/vchandlerpython.py", line 208, in call
loop.run_until_complete(asgi_task)
File "/var/lang/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/var/task/fastapi/applications.py", line 276, in call
await super().call(scope, receive, send)
File "/var/task/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/var/task/starlette/middleware/errors.py", line 184, in call
raise exc
File "/var/task/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/var/task/starlette/middleware/gzip.py", line 26, in call
await self.app(scope, receive, send)
File "/var/task/starlette/middleware/base.py", line 108, in call
response = await self.dispatch_func(request, call_next)
File "/var/task/app/init.py", line 57, in some_middleware
response = await call_next(request)
File "/var/task/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/var/task/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/var/task/starlette/middleware/sessions.py", line 86, in call
await self.app(scope, receive, send_wrapper)
File "/var/task/starlette/middleware/base.py", line 108, in call
response = await self.dispatch_func(request, call_next)
File "/var/task/app/init.py", line 46, in add_process_time_header
response = await call_next(request)
File "/var/task/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/var/task/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/var/task/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/var/task/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/var/task/fastapi/middleware/asyncexitstack.py", line 21, in call
raise e
File "/var/task/fastapi/middleware/asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "/var/task/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/var/task/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/var/task/starlette/routing.py", line 66, in app
response = await func(request)
File "/var/task/fastapi/routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "/var/task/fastapi/routing.py", line 163, in run_endpoint_function
return await dependant.call(**values)
File "/var/task/fastapi_cache/decorator.py", line 113, in inner
coder = coder or FastAPICache.get_coder()
File "/var/task/fastapi_cache/init__.py", line 63, in get_coder
assert cls._coder, "You must call init first!" # nosec: B101
hello, im trying to setup fastapi with cache support in vercel but i get this error
[ERROR] AssertionError: You must call init first! Traceback (most recent call last): File "/var/task/vchandlerpython.py", line 305, in vc_handler response = asgi_cycle(vc_module.app, body) File "/var/task/vchandlerpython.py", line 208, in call loop.run_until_complete(asgi_task) File "/var/lang/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/var/task/fastapi/applications.py", line 276, in call await super().call(scope, receive, send) File "/var/task/starlette/applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "/var/task/starlette/middleware/errors.py", line 184, in call raise exc File "/var/task/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/var/task/starlette/middleware/gzip.py", line 26, in call await self.app(scope, receive, send) File "/var/task/starlette/middleware/base.py", line 108, in call response = await self.dispatch_func(request, call_next) File "/var/task/app/init.py", line 57, in some_middleware response = await call_next(request) File "/var/task/starlette/middleware/base.py", line 84, in call_next raise app_exc File "/var/task/starlette/middleware/base.py", line 70, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/var/task/starlette/middleware/sessions.py", line 86, in call await self.app(scope, receive, send_wrapper) File "/var/task/starlette/middleware/base.py", line 108, in call response = await self.dispatch_func(request, call_next) File "/var/task/app/init.py", line 46, in add_process_time_header response = await call_next(request) File "/var/task/starlette/middleware/base.py", line 84, in call_next raise app_exc File "/var/task/starlette/middleware/base.py", line 70, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/var/task/starlette/middleware/exceptions.py", line 79, in call raise exc File "/var/task/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/var/task/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/var/task/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/var/task/starlette/routing.py", line 718, in call await route.handle(scope, receive, send) File "/var/task/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/var/task/starlette/routing.py", line 66, in app response = await func(request) File "/var/task/fastapi/routing.py", line 237, in app raw_response = await run_endpoint_function( File "/var/task/fastapi/routing.py", line 163, in run_endpoint_function return await dependant.call(**values) File "/var/task/fastapi_cache/decorator.py", line 113, in inner coder = coder or FastAPICache.get_coder() File "/var/task/fastapi_cache/init__.py", line 63, in get_coder assert cls._coder, "You must call init first!" # nosec: B101
this is the code
is anything im doing wrong?