-
Notifications
You must be signed in to change notification settings - Fork 5
Lambda Handler not being found when viewing the generated API Stage #118
Comments
Hi @connormcwood, would you be able to share a repro where I can reproduce the problem? If not, could you please share the generated files and/or the generated terraform configuration? |
Take a look at https://github.com/connormcwood/dr-frontend I use a bash script to move the generated files and apply the terraform. Just go into the app directory run I believe an improvement to be made for the generated terraform is to maybe improve the depends on for the resources since when I first deploy the script some of the resources fail as I believe they were not created in time.
Third attempt was met with success. Once we get the Gateway working maybe we should split these out into separate issues so that they can be worked on. It is worth noting that I am using ubuntu to deploy and I have had issues with files not being able to be deleted. Anyway take a look, maybe there is something obvious I have done wrong. Thank you |
As the issue suggests. The handler is not being found when the main js file is exporting the handler.
|
Changing the package dependencies to the following:
|
Yes, I found out that one of the latest version has broken the lambdas. I will revert that change and release a new version shortly |
Sorry for the constant messages. Are you able to provide me with a working example so I could have a play around until the fixes are implemented. Wanting to make sure the project works prior to contributing. Thank you |
Try using version 1.1.0, that should have a working lambda! |
I use the very same lambda code at work (v1.1.0) so it does work |
I should have mentioned that along with locking the exact versions of react, react-dom, and next I also locked the version of the plugin to 1.1.0. It did fix the issue with the lambda source code however when going to the created link and one of the endpoints set up the page just times out. |
@connormcwood could give a spin to |
Hi @ematipico making progress. I believe a dependency has now been added since I updated and it required cosmiconfig to be installed. Additionally, the lambda code is compiled like: I manually removed the text line breaks. After removing the added spaces and line breaks I can see the html although the static file doesnt work but I believe an S3 bucket would be used for that. |
About the breaking lines, that's probably due to the About the static file, do you talk the static assets generated by Next.js? If so, they will have to be uploaded separately. |
|
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
Specifications
Example of lambda contents:
"\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.
The text was updated successfully, but these errors were encountered: