diff --git a/src/ServerlessOffline.js b/src/ServerlessOffline.js index 3db0276d9..30a049c51 100644 --- a/src/ServerlessOffline.js +++ b/src/ServerlessOffline.js @@ -183,7 +183,9 @@ export default class ServerlessOffline { } async _createLambda(lambdas, skipStart) { - const { default: Lambda } = await import('./lambda/index.js') + const { + default: { default: Lambda }, + } = await import('./lambda/index.js') this.#lambda = new Lambda(this.#serverless, this.#options, this.v3Utils) @@ -195,7 +197,9 @@ export default class ServerlessOffline { } async _createHttp(events, skipStart) { - const { default: Http } = await import('./events/http/index.js') + const { + default: { default: Http }, + } = await import('./events/http/index.js') this.#http = new Http( this.#serverless, @@ -222,7 +226,9 @@ export default class ServerlessOffline { } async #createSchedule(events) { - const { default: Schedule } = await import('./events/schedule/index.js') + const { + default: { default: Schedule }, + } = await import('./events/schedule/index.js') this.#schedule = new Schedule( this.#lambda, @@ -234,7 +240,9 @@ export default class ServerlessOffline { } async #createWebSocket(events) { - const { default: WebSocket } = await import('./events/websocket/index.js') + const { + default: { default: WebSocket }, + } = await import('./events/websocket/index.js') this.#webSocket = new WebSocket( this.#serverless, diff --git a/src/lambda/handler-runner/HandlerRunner.js b/src/lambda/handler-runner/HandlerRunner.js index 10c4deeb2..0cfc37b72 100644 --- a/src/lambda/handler-runner/HandlerRunner.js +++ b/src/lambda/handler-runner/HandlerRunner.js @@ -71,7 +71,9 @@ export default class HandlerRunner { readOnly: this.#options.dockerReadOnly, } - const { default: DockerRunner } = await import('./docker-runner/index.js') + const { + default: { default: DockerRunner }, + } = await import('./docker-runner/index.js') return new DockerRunner( this.#funOptions, this.#env, @@ -82,9 +84,9 @@ export default class HandlerRunner { if (supportedNodejs.has(runtime)) { if (useChildProcesses) { - const { default: ChildProcessRunner } = await import( - './child-process-runner/index.js' - ) + const { + default: { default: ChildProcessRunner }, + } = await import('./child-process-runner/index.js') return new ChildProcessRunner( this.#funOptions, this.#env, @@ -94,9 +96,9 @@ export default class HandlerRunner { } if (useWorkerThreads) { - const { default: WorkerThreadRunner } = await import( - './worker-thread-runner/index.js' - ) + const { + default: { default: WorkerThreadRunner }, + } = await import('./worker-thread-runner/index.js') return new WorkerThreadRunner(this.#funOptions, this.#env, allowCache) } @@ -114,12 +116,16 @@ export default class HandlerRunner { } if (supportedGo.has(runtime)) { - const { default: GoRunner } = await import('./go-runner/index.js') + const { + default: { default: GoRunner }, + } = await import('./go-runner/index.js') return new GoRunner(this.#funOptions, this.#env, this.v3Utils) } if (supportedPython.has(runtime)) { - const { default: PythonRunner } = await import('./python-runner/index.js') + const { + default: { default: PythonRunner }, + } = await import('./python-runner/index.js') return new PythonRunner( this.#funOptions, this.#env, @@ -129,7 +135,9 @@ export default class HandlerRunner { } if (supportedRuby.has(runtime)) { - const { default: RubyRunner } = await import('./ruby-runner/index.js') + const { + default: { default: RubyRunner }, + } = await import('./ruby-runner/index.js') return new RubyRunner( this.#funOptions, this.#env, @@ -139,7 +147,9 @@ export default class HandlerRunner { } if (supportedJava.has(runtime)) { - const { default: JavaRunner } = await import('./java-runner/index.js') + const { + default: { default: JavaRunner }, + } = await import('./java-runner/index.js') return new JavaRunner( this.#funOptions, this.#env,