question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SendMessage import error

See original GitHub issue

SendMessage lamda function is throwing exception if I send this message: {"message":"sendMessage", "data":"hello world"} image

I deployed it directly using serverless repo and haven’t changed a single line of code.

Cloudwatch logs: image

Complete logs:

START RequestId: 041b19b4-8d3f-4247-8d4c-16ba493b7b0f Version: $LATEST
Unable to import module 'app': Error
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/task/node_modules/aws-sdk/clients/apigatewaymanagementapi.js:1:63)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
END RequestId: 041b19b4-8d3f-4247-8d4c-16ba493b7b0f
REPORT RequestId: 041b19b4-8d3f-4247-8d4c-16ba493b7b0f	Duration: 1.85 ms	Billed Duration: 100 ms 	Memory Size: 256 MB	Max Memory Used: 84 MB	

This error is related to require('aws-sdk/clients/apigatewaymanagementapi'); “aws-sdk”: “^2.404.0” is already present in dependencies so I don’t know why this is happening.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
markotitelcommented, May 13, 2019

What helped me is change NodeJS version to 10.x, with commented require('aws-sdk/clients/apigatewaymanagementapi'); I will try do to my first PR to see if I can do it properly and to see if this is proper programatic solution.

EDIT: Hope I have properly followed contribution guide. https://github.com/aws-samples/simple-websockets-chat-app/pull/25

1reaction
dgomesbrcommented, Apr 2, 2019

That was an early dependency node_modules folder, not anymore. Now you should be able to do it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - pub.sendMessage is not working in my code
I think the guts of the issue is that you have no method to stop the thread. If you don't stop the thread...
Read more >
Pub Module — Pypubsub v4.0.3 Documentation
Sending messages is achieved via the following function: ... Raised when a sendMessage() is missing arguments tagged as 'required' by pubsub topic of...
Read more >
Can't send message · Issue #1378 · adiwajshing/Baileys
Hey guys, Im trying to implement whatsapp:legacy using steps to run example-legacy.ts. But it seems like I cant send a simple text message....
Read more >
transport.sendMessage failure - Oracle Communities
I tried using the session debug, and did get more messages as the code ran through. however, as for the error message its-self,...
Read more >
Send Message Error - Postbox Support
If you are receiving any of the following messages: Send Message Error Sending of message failed.An error occurred sending mail: SMTP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found