CodeGenieApp / serverless-express

Run Express and other Node.js frameworks on AWS Serverless technologies such as Lambda, API Gateway, Lambda@Edge, and more.
https://codegenie.codes
Apache License 2.0
5.14k stars 667 forks source link

cant import middleware as es6 module #527

Open JOEAV opened 2 years ago

JOEAV commented 2 years ago

Hey, i'm trying to consume the middleware module as esm moudle with no luck tried import {eventContext} from '@vendia/serverless-express/middleware' but got an error stating there is no such module.

how can import the middleware (in order to get the eventContext) in a modern way (i'm using version 3.4.0) p.s all the examples in docs wont show how to use import but only the require way . thanks

brettstack commented 2 years ago

I've added the "help wanted" label if someone wants to add support

marcodali commented 12 months ago

Have you tried with

import * as awsServerlessExpress from "aws-serverless-express"