f.ClientHandshake is not a constructor
See original GitHub issueHi,
When I use the package locally, everything works fine. However, when I use it inside an AWS Lambda function to connect to an RDS instance, I get this cryptic error:
TypeError: f.ClientHandshake is not a constructor
at new g (/var/task/index.js:275:62824)
at new o (/var/task/index.js:275:224046)
at e.exports.getConnection (/var/task/index.js:275:218705)
at e.exports.execute (/var/task/index.js:275:220197)
at /var/task/index.js:275:372341
at new Promise (<anonymous>)
at c.execute (/var/task/index.js:275:372308)
at /var/task/index.js:357:14189
at E (/var/task/index.js:316:24416)
at Generator._invoke (/var/task/index.js:316:24204)
Any idea what the issue is? I’m confident that the roles/security groups are all configured correctly.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:16 (10 by maintainers)
Top Results From Across the Web
mysql2 TypeError: f.ClientHandshake is not a constructor
Turns out disabling minification in Webpack fixed the issue. This can be done by updating the webpack.config.js to include
Read more >mysql2 TypeError: f.ClientHandshake is not a constructor
I'm trying to use mysql2 to connect to an RDS MySQL instance. When I use the package ... that the roles/security groups are...
Read more >TypeError: StoryblokClient is not a constructor : r/webdev
hey, as you can see here storyblokClient is definetly an object, however when I use it like that it throws this error (note:...
Read more >User BarthesSimpson - Server Fault
mysql2 TypeError: f.ClientHandshake is not a constructor. 9. secure cookies node.js + Heroku + CloudFlare. 8. Longest common subsequence of 3+ strings ...
Read more >WebSocketAdapter (components 1.1.4 API)
void, onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request). This default implementation does not do anything which will cause the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @sidorares Unfortunately, I lost a day facing the same issue, but not with AWS. Thanks to https://stackoverflow.com/questions/53524510/mysql2-typeerror-f-clienthandshake-is-not-a-constructor, I finally understood the problem was coming with Webpack as I use typescript.
However, why is this ticket closed? There is still an issue, because as soon as you minify the code for production, your module doesn’t work any more.
Please consider this issue (it might maybe only concern users using Typescript, but still, it’s an issue)
Thank you in advance
Yes, I’m using Webpack to bundle it. I did just notice I get a warning during the packaging stage that may be related