Unexpected token var running endpoint with deconstruction


#1

Hi,

i get the error Unexpected token var when using deconstruction inside an endpoint.
The same code run endpointless work with no error.

Here a runkit to reproduce the error: https://runkit.com/alfredosalzillo/5c7facd0ce32ed0012e8fa6d#.

Running the endpoint i get this error.

image


#2

Hey @alfredosalzillo.
I’m getting no errors. Maybe NPM/Node has been updated.
Please come back with your results,
Sasial.


#3

Picture:


#4

The error is using the endpoint, https://untitled-cvb7gxuakta3.runkit.sh/


#5

Hi There,

Sorry for the delay, we’ve fixed your issue and your endpoint should work now.

There will be one issue with your code, because it’s a node response object (not Express), you want to use response.end(), instead of .send().

Thanks for reporting this issue, and please let us know if you run into any more problems!

- Randy