File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,19 @@ const evalInContext = require('./eval')
13
13
const createMQTTBroker = require ( './broker' )
14
14
// TODO: send PR to serverless-offline to export this
15
15
const functionHelper = require ( 'serverless-offline/src/functionHelper' )
16
- const createLambdaContext = require ( 'serverless-offline/src/createLambdaContext' )
16
+ let createLambdaContext ;
17
+
18
+ try {
19
+ createLambdaContext = require ( 'serverless-offline/src/createLambdaContext' ) ;
20
+ } catch ( e ) {
21
+ try {
22
+ // latest serverless-offline changed the file name
23
+ createLambdaContext = require ( 'serverless-offline/src/LambdaContext' ) ;
24
+ } catch ( e2 ) {
25
+ throw new Error ( 'Unable to find LambdaContext file' ) ;
26
+ }
27
+ }
28
+
17
29
const VERBOSE = typeof process . env . SLS_DEBUG !== 'undefined'
18
30
const defaultOpts = {
19
31
host : 'localhost' ,
You can’t perform that action at this time.
0 commit comments