Serverless v4 supports TypeScript out of the box. To resolve the module loading issue, I have updated the UserFunction file and integrated tsx to execute TypeScript files.
How Has This Been Tested?
Unit tests and manually tested the helloTypescript endpoint locally using the test suite located at tests/manual/nodejs
Description
When using Serverless v4 with TypeScript, the following error occurs:
You can reproduce this issue with the repository https://github.com/NicoHinderling/simple-serverless4-offline-example/tree/main Fixes #1800
Motivation and Context
Serverless v4 supports TypeScript out of the box. To resolve the module loading issue, I have updated the UserFunction file and integrated tsx to execute TypeScript files.
How Has This Been Tested?
Unit tests and manually tested the helloTypescript endpoint locally using the test suite located at
tests/manual/nodejs