software
software

Reputation: 1

Cannot find package 'aws-sdk' imported from /var/task/index.mjs

i am getting this error even after having the correct configuration using nodejs 18

{
    "errorType": "ReferenceError",
    "errorMessage": "require is not defined in ES module scope, you can use import instead",
    "trace": [
        "ReferenceError: require is not defined in ES module scope, you can use import instead",
        "    at file:///var/task/index.mjs:1:13",
        "    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)",
        "    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)",
        "    at async _tryAwaitImport (file:///var/runtime/index.mjs:1008:16)",
        "    at async _tryRequire (file:///var/runtime/index.mjs:1057:86)",
        "    at async _loadUserApp (file:///var/runtime/index.mjs:1081:16)",
        "    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)",
        "    at async start (file:///var/runtime/index.mjs:1282:23)",
        "    at async file:///var/runtime/index.mjs:1288:1"
    ]
}

let me know what could be the possible reason

i tried changing file configurtaions, and changeing file type but got the same issue

Upvotes: 0

Views: 935

Answers (0)

Related Questions