I'm trying to migrate a Twilio functions repo to use TypeScript. I completely rewritten one of the functions via TypeScript and successfully tested it locally. However, after I deployed the function, it started returning 500 with the following error:
"message": "Cannot find module '@twilio-labs/serverless-runtime-types'
I'm trying to find out how I can correctly import and use types.
Some context:
Mainly followed this guide: https://www.twilio.com/blog/twilio-functions-typescript
Deployed the repo via:
twilio serverless:deploy --functions-folder build/src/functions --runtime node14 --override-existing-projectBefore compiling to javascript my import statement looks like this:
import '@twilio-labs/serverless-runtime-types'; import * as VoiceResponse from '@twilio-labs/serverless-runtime- types/node_modules/twilio/lib/twiml/VoiceResponse'; import { Context, ServerlessCallback, ServerlessFunctionSignature, TwilioClient } from '@twilio-labs/serverless-runtime-types/types';And after compiling the import statement looks like this:
require("@twilio-labs/serverless-runtime-types");