Skip to content
This repository was archived by the owner on Jul 23, 2023. It is now read-only.
This repository was archived by the owner on Jul 23, 2023. It is now read-only.

Lambda Handler not being found when viewing the generated API Stage #118

Closed
@connormcwood

Description

@connormcwood

Issue

NodeJS 8.10 Handler 'render' missing on module 'contact'
NodeJS 10.x Contact.render is undefined or not exported

Expected Behavior

Page to be displayed.

Actual Behavior

Error message is shown and stack is logged to cloudwatch.

Steps to Reproduce the Problem

  1. Generate Example as shown in the integration section of the repository.
  2. Do a terraform apply
  3. Go to the generated link from the API Gateway and navigate to one of the routes.
  4. Review the cloudwatch log generated.

Specifications

  • Next 9.1.2
  • React 16.11.0
  • React-dom 16.11
  • Node 8.10 (Did try 10.x with updating the lambdas too)
  • Terraform v0.11.15
  • Version: latest
  • Platform: Ubuntu / AWS
  • Subsystem:

Example of lambda contents:

  • Contact.js
    "\n\nconst page = require('./contact.original.js');\nconst http = require('http')\n\nexports.render = (event, context, callback) => {\n\tconst server = new http.Server((req, res) => page.render(req, res));\n\tserver.listen(3000);\n};\n\n\n"

I have set the nextJs config to be serverless but it could be that it is not picking it up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions