-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getParameterSync results in Runtime.UserCodeSyntaxError: SyntaxError: Unexpected end of JSON input #25
Comments
Thought I'd check out the
This is my code for reference:
|
I've hit a problem very similar to yours, and I think I know the reason. Look here: aws-param-store/lib/param_query.js Line 125 in 00c4262
What the code tries to do is to spawn another node process and communicate with it over stdin/stdout. Basically, the library tries to run aws-param-store/lib/param_query.js Line 131 in 00c4262
JSON.parse() on empty string, which produces exactly the error message we see. I think (didn't try) that the problem can be resolved by telling webpack that ssm_sync.js , ssm.js and aws_paginated_call.js files have to be copied next to what webpack produces.
Update: I've added the following to webpack config, and the problem is gone:
|
This happens on AWS lambda Node 14.x. Running the same code on our ECS service did not result in this error. Not sure exactly what is causing it, but switching to the async call
getParameter
fixed the error for us, so seems like there is a bug in the sync version of getParameter.Here's the full stack trace, but it's not very helpful:
The text was updated successfully, but these errors were encountered: