Syntax error: invalid number when using octal literals in code step

This topic was automatically generated from Slack. You can find the original thread here.

Richard Ayles : Hi all,
I have a private workflow that was working on a daily scheduled task
I adjust a JSON array of strings in a nodejs step
and ever since I have been getting the below syntax error
It doesn’t appear to be getting to my console log in the command after the trigger

Anyone able to add some insight as to where the issue might be
Previously when it did run I received a timer_config entry and not “manual”

image.png

image.png

Richard Ayles :

image.png

Dylan Sather (Pipedream) : could you click the Share button at the top-right corner of your workflow and share it with dylan@pipedream.com? I’d like to take a look at the workflow’s code

Richard Ayles : Hi I hjave just shared it with you

Dylan Sather (Pipedream) : Thank you, nothing immediately stands out as an issue with your code, but I’m troubleshooting more.

Could you try one thing that sometimes resolves these issues? Click the icon at the top-right of your workflow and copy it, then try running the copy and see if that works.

Screen Shot 2021-10-18 at 10.56.30 AM.png

Richard Ayles : still no joy

Dylan Sather (Pipedream) : I identified the issue - it appears to be an issue on our side. I’ll let you know when we’ve addressed it

Richard Ayles : :thumbsup:

Dylan Sather (Pipedream) : this was a bit more subtle than I expected. I believe you’ll need to change this line:

const today = new Date().setHours(09,00,00,000);

to this:

const today = new Date().setHours(9, 0, 0, 0);

The 0-prefixed values in the first line are getting interpreted as octal literals, and 0-prefixed octal literals have been recently deprecated in strict mode.

Let me know if that works for you.

Richard Ayles : thanks that fixed it, has something changed on validation as that had been running without issue for the last 50 odd days!! Either way thank you for your help

Dylan Sather (Pipedream) : Yes, we made some changes to our execution environment that triggered this error. I’m sorry it caused this issue. If you ever see any other oddities, feel free to reach out again!

Richard Ayles : :thumbsup: thanks for the explanation

Richard Ayles : thanks for your help