Skip to content

Commit f3970e1

Browse files
Switch exports to module.exports
There’s [a](https://blog.tableflip.io/the-difference-between-module-exports-and-exports/) [few](https://stackoverflow.com/questions/16383795/difference-between-module-exports-and-exports-in-the-commonjs-module-system) [weird](https://stackoverflow.com/questions/7137397/module-exports-vs-exports-in-node-js) [differences](https://www.sitepoint.com/understanding-module-exports-exports-node-js/) between module.exports and exports. By using `module.exports`, I am able to fix my `Error: Cannot find module` error. All said and done, I’m glad I can deploy nest.js with claudia.js 😄 Funny enough, the [Nestjs example](https://github.com/janaz/lambda-request-handler/blame/master/README.md#L177) is the only one that needs fixing 😂
1 parent 22411c4 commit f3970e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const getApp = async () => {
174174

175175
const handler = lambdaRequestHandler.deferred(getApp);
176176

177-
exports = { handler }
177+
module.exports = { handler }
178178
```
179179

180180
If the above file in your Lambda source was called `index.ts`, compiled to `index.js` then the name of the handler in the Lambda configuration is `index.handler`

0 commit comments

Comments
 (0)