electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.2k stars 351 forks source link

Vercel/Serverless broken after apollo-server upgrade on develop #307

Closed electerious closed 2 years ago

electerious commented 2 years ago

🐞 Describe the bug

The Vercel deployment is broken after upgrading apollo-server-lambda to version 3 (maybe other serverless solutions are broken, too). The code seems to be correct according to the Apollo docs, but the serverless function is throwing the following error when /api gets called:

[POST] /api
19:28:08:34
2022-01-09T18:28:10.719Z    2014d7ba-295d-4344-a94a-007608d4788b    ERROR   Invoke Error    {"errorType":"Error","errorMessage":"Unable to determine event source based on event.","stack":["Error: Unable to determine event source based on event.","    at getEventSourceNameBasedOnEvent (/var/task/node_modules/@vendia/serverless-express/src/event-sources/utils.js:88:9)","    at proxy (/var/task/node_modules/@vendia/serverless-express/src/configure.js:38:51)","    at handler (/var/task/node_modules/@vendia/serverless-express/src/configure.js:99:12)","    at Object.handler (/var/task/node_modules/apollo-server-lambda/dist/ApolloServer.js:51:27)"]}

⚙️ Environment

electerious commented 2 years ago

Related: https://github.com/apollographql/apollo-server/issues/6005

apollo-server-lambda is designed to be run on Lambda. Vercel is not Lambda

tkw1536 commented 2 years ago

Is there any particular reason for not staying on apollo-server-lambda==v2.25.3 (or whatever the latest 2.x version is)?