Uncaught ReferenceError: module is not defined

I am using a lambda function to call another AWS API and wanted to hide the API key. I am using environment variables for the same but I keep running into this runtime error saying module not defined. Already tried and applied the suggestions in forums. Is there something wrong with the way my folders are structured?

package.json has the module dependency mentioned.

I think the dependencies that you need in your functions should also exist in the primary package.json that you have in your project root.

It is already there yet I am facing the error.

Share your code if possible then, or a minimal reproduction.

` {

  "dependencies": {

    "dotenv": "^8.2.0",

    "module": "^1.2.5",

    "netlify": "^6.1.18",

    "require": "^2.4.20",

    "requirejs": "^2.3.6",

    "netlify-cli": "^2.69.11"


  "scripts": {

    "prebuild" : "node ./installer.js",

    "netlify": "./node_modules/.bin/netlify"



This is my package.json file

No I meant, the repo, the source code which would help us check for the problem or try it at our end.