You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SyntaxError: Unexpected token f
at Object.parse (native)
at /usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/compile/events/schedule/index.js:123:41
at Array.forEach (native)
at /usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/compile/events/schedule/index.js:21:28
The f comes from the functionId in the body. If I remove the f, the error becomes Unexpected token u (from "unctionId").
Looking at the code, the problem is with escaping the input in lib/plugins/aws/deploy/compile/events/schedule/index.js in the variable scheduleTemplate. The quotes in the body get transformed to \" in Input, and then to \\" in scheduleTemplate. Note the missing backslash - only the original backslack gets escaped, not the quotes.
I was able to hack a quick fix together and it works (not suggesting as a fix, just to illustrate that this would fix it). The original scheduleTemplate was renamed to scheduleTemplate2 before:
This is a Bug Report
Description
With the following schedule configuration:
I get the following exception:
The
f
comes from thefunctionId
in the body. If I remove the f, the error becomesUnexpected token u
(from "unctionId").Looking at the code, the problem is with escaping the input in
lib/plugins/aws/deploy/compile/events/schedule/index.js
in the variablescheduleTemplate
. The quotes in the body get transformed to\"
inInput
, and then to\\"
inscheduleTemplate
. Note the missing backslash - only the original backslack gets escaped, not the quotes.I was able to hack a quick fix together and it works (not suggesting as a fix, just to illustrate that this would fix it). The original
scheduleTemplate
was renamed toscheduleTemplate2
before:Additional Data
The text was updated successfully, but these errors were encountered: