'Event references not configured authorizer 'authorizerFunc'

I'm using typescript and serverless framework to build an API. Here is my source code: https://github.com/liou-jia-hao/api/tree/add-ajv

I follow this tutorial to build custom authorizers: https://www.serverless.com/framework/docs/providers/aws/events/apigateway#http-endpoints-with-custom-authorizers

But I get this error:

PS D:\src\social-app-api> serverless deploy

Deploying social-app to stage dev (ap-northeast-1)
Compiling with Typescript...
Using local tsconfig.json - tsconfig.json
Typescript compiled.

× Stack social-app-dev failed to deploy (163s)
Environment: win32, node 14.18.2, framework 3.1.1, plugin 6.0.0, SDK 4.3.1
Credentials: Local, "default" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Event references not configured authorizer 'authorizerFunc'

I found this issue on serverless repo: https://github.com/serverless/serverless/issues/8781 But after read this issue I just saw BryanCrotaz say work it out. But I still don't know how to solve this error.



Solution 1:[1]

I followed the new tutorial and solved it: https://www.serverless.com/framework/docs/providers/aws/events/http-api#lambda-request-authorizers

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kody Liou