CodeGenieApp / CodeGenieApp/serverless-express

TypeError: Cannot read property 'callback' of undefined

Offen
#485 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
5.3k
Forks
676
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

```
const { getCurrentInvoke } = require('@vendia/serverless-express')
app.get('/', (req, res) => {
const { event, context } = getCurrentInvoke()

res.json(event)
})
```

What is wrong about the code above? I'm getting the following error:

```
TypeError: Cannot read property 'callback' of undefined
at getFramework (/my-app/node_modules/@vendia/serverless-express/src/frameworks/index.js:7:18)
at configure (/my-app/node_modules/@vendia/serverless-express/src/configure.js:22:35)
at ResizeToThreeDimensionsController.handle (/my-app/src/adapters/resizeToThreeDimensionsController.ts:81:40)
at Layer.handle [as handle_request] (/my-app/node_modules/express/lib/router/layer.js:95:5)
at next (/my-app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/my-app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/my-app/node_modules/express/lib/router/layer.js:95:5)
at /my-app/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/my-app/node_modules/express/lib/router/index.js:341:12)
at next (/my-app/node_modules/express/lib/router/index.js:275:10)
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by tracing the getCurrentInvoke call through src/frameworks/index.js and src/configure.js, using the stack trace and the shown Express route as the entry points. Determine why the framework configuration is undefined in this usage, then verify the corrected invocation and confirm that the route returns the current event without the TypeError.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, express, javascript, node.js
Bereich
api, backend, cloud
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.