Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error: Cannot find module './rapid-client.node'

Open
#105 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, node.js, typescript
Domain
backend, cloud

Research direction

Start by reproducing the reported Lambda Docker setup with the alternative base image, then inspect the installed aws-lambda-ric package and the NativeModuleLoader path in node_modules/aws-lambda-ric/dist/index.mjs. Done means the package includes a loadable rapid-client.node and the runtime starts successfully without the MODULE_NOT_FOUND error.

Written by the indexing model from the issue text.

Description

Hello, I am getting this error trying to run a docker on a lambda using an alternative base image with the runtime interface client.

`7 Apr 2024 14:01:50,774 [INFO] (rapid) exec '/usr/local/bin/npx' (cwd=/function, handler=index.handler)
17 Apr 2024 14:01:57,708 [INFO] (rapid) INIT START(type: on-demand, phase: init)
17 Apr 2024 14:01:57,709 [INFO] (rapid) The extension's directory "/opt/extensions" does not exist, assuming no extensions to be loaded.
START RequestId: 79953563-5601-4e3c-b77c-ab118b367ef4 Version: $LATEST
17 Apr 2024 14:01:57,711 [INFO] (rapid) Starting runtime without AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN , Expected?: false
Executing 'index.handler' in function directory '/function'
node:internal/modules/cjs/loader:1140
const err = new Error(message);
^

Error: Cannot find module './rapid-client.node'
Require stack:

  • /function/node_modules/aws-lambda-ric/dist/index.mjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Module._load (node:internal/modules/cjs/loader:981:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at NativeModuleLoader.js.exports.load (file:///function/node_modules/aws-lambda-ric/dist/index.mjs:439:26)
    at new RAPIDClient (file:///function/node_modules/aws-lambda-ric/dist/index.mjs:454:74)
    at run (file:///function/node_modules/aws-lambda-ric/dist/index.mjs:1411:18)
    at file:///function/node_modules/aws-lambda-ric/bin/index.mjs:14:7
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/function/node_modules/aws-lambda-ric/dist/index.mjs' ]
    }

Node.js v18.20.2
17 Apr 2024 14:01:58,891 [WARNING] (rapid) First fatal error stored in appctx: Runtime.ExitError
17 Apr 2024 14:01:58,892 [WARNING] (rapid) Process runtime-1 exited: exit status 1
17 Apr 2024 14:01:58,892 [INFO] (rapid) INIT RTDONE(status: error)
17 Apr 2024 14:01:58,892 [INFO] (rapid) INIT REPORT(durationMs: 1185.888000)
17 Apr 2024 14:01:58,892 [ERROR] (rapid) Init failed InvokeID= error=Runtime exited with error: exit status 1
17 Apr 2024 14:01:58,893 [WARNING] (rapid) Shutdown initiated: spindown
17 Apr 2024 14:01:58,893 [INFO] (rapid) Waiting for runtime domain processes termination
17 Apr 2024 14:01:58,894 [INFO] (rapid) INIT START(type: on-demand, phase: invoke)
17 Apr 2024 14:01:58,894 [INFO] (rapid) The extension's directory "/opt/extensions" does not exist, assuming no extensions to be loaded.
17 Apr 2024 14:01:58,894 [INFO] (rapid) INIT REPORT(durationMs: 0.060000)
17 Apr 2024 14:01:58,894 [INFO] (rapid) INVOKE START(requestId: 0fd547e3-fe80-44eb-a9e2-67b5cb4b8000)
17 Apr 2024 14:01:58,894 [ERROR] (rapid) Invoke failed error=Runtime exited with error: exit status 1 InvokeID=0fd547e3-fe80-44eb-a9e2-67b5cb4b8000
17 Apr 2024 14:01:58,897 [ERROR] (rapid) Invoke DONE failed: Sandbox.Failure
17 Apr 2024 14:01:58,897 [WARNING] (rapid) Reset initiated: ReleaseFail
17 Apr 2024 14:01:58,897 [INFO] (rapid) Waiting for runtime domain processes termination`

The rapid-client library is installed but does not have an exportable node file.

image
Dominant language
TypeScript
Stars
224
Forks
60
Avg merge
26m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-lambda-nodejs-runtime-interface-client

All issues in aws/aws-lambda-nodejs-runtime-interface-client

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.