Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fresh twilio-cli installation, and trying to create a typescript project has type errors #611

Open
Haiz14 opened this issue Oct 9, 2024 · 2 comments

Comments

@Haiz14
Copy link

Haiz14 commented Oct 9, 2024

Issue Summary

installed a new twilio-cli via apt keyring twilio --version twilio-cli/5.22.3 wsl-x64 node-v18.20.4
but a new project created with it twilio serverless:init teste --typescript has type issues.

 ~/teste> npm run start

> [email protected] prestart
> npm run build


> [email protected] build
> tsc && npm run build:copy-assets

src/functions/hello-world.ts:21:14 - error TS2322: Type '(context: Context<MyContext>, event: MyEvent, callback: ServerlessCallback) => void' is not assignable to type 'ServerlessFunctionSignature'.
  Types of parameters 'event' and 'event' are incompatible.
    Type '{ request: { cookies: {}; headers: {}; }; }' has no properties in common with type 'MyEvent'.

21 export const handler: ServerlessFunctionSignature = function(
                ~~~~~~~


Found 1 error in src/functions/hello-world.ts:21

Steps to Reproduce

  1. install twilio-cli via apt
  2. run twilio serverless:init teste --t typescript a prompt to download serverless plugin will occur
  3. run above command again
  4. cd teste && npm run start

Technical details:

  • twilio-cli version: twilio-cli/5.22.3 wsl-x64 node-v18.20.4
  • node version: v18.19.1
@Haiz14
Copy link
Author

Haiz14 commented Oct 9, 2024

the problem is not that i can't fix it. but fresh installations should work, right?

@Haiz14
Copy link
Author

Haiz14 commented Oct 9, 2024

the twilio-runtime version set as default in package.json via twilio serverless:init teste --typescript is 2.0.3. while available via npm. but not available in twilio-serverlessenvironment.

the latest available dependency seems to be 2.0.1 according to docs https://www.twilio.com/docs/serverless/functions-assets/handler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant