Code was working yesterday, went on to work on it ...
# 🤝help
b
Code and error message below. if (workflow.whatIssue === 'Dryness (Chap lips, Dry skin)') { workflow.nextMsg += '\nHey, tackling dry skin with natural goodies is great because they moisturize just like your skin\'s own hydration process, but without any fuss. Plus, they\'re loaded with skin-loving nutrients for that healthy, glow-up vibe.' workflow.nextMsg2 += '\n For dry skin anywhere on your body, I recommend the "Fix Your Sht" Healing Balm. It\'s jam packed with plant based and natural ingredients to soothe your dry skin fast, and comes in various sizes.' workflow.nextMsg3 += "[Click Here - Fix Your Sh*t](https://gingerganics.com/products/fix-your-sht-healing-balm?variant=43060603617509)"; } else if (workflow.whatIssue === 'Damaged Skin (Sunburns, Wounds)') { workflow.nextMsg += '\nNo doubt, using Gingerganics natural goodies on damaged skin is a real game-changer! They\'re gentle on sunburns and wounds, avoiding the harshness of artificial stuff, plus they\'re packed with nourishing ingredients to help your skin bounce back faster.' workflow.nextMsg2 += '\n Fix Your Sh*t by Gingerganics is like a magic in a jar for your skin! Packed with all-natural ingredients, it gets down to business, repairing skin damage, soothing sunburns, helping wounds heal, and so much more, all while being kind and gentle to your skin.' workflow.nextMsg3 += "[Click Here - Fix Your Sh*t](https://gingerganics.com/products/fix-your-sht-healing-balm?variant=43060603617509)"; } (Discord wont let me send the full code, but the rest is just 3 more of those sections.) 11:20:31errorError executing action "inline-ins-53e4d4f34d.js" in flow:Main:node:product [SyntaxError, Unexpected EOF]

https://cdn.discordapp.com/attachments/1133465166772707368/1133465167053734000/image.png

r
@bumpy-morning-51656 is this code auto-generated? it's hard to see on discord, but looks like the syntax is incorrect
b
its not auto generated, it may look that way because i am not the best at coding
what would I change the syntax to?
r
The syntax error may be a single character on a single line. Difficult to say without the entire code block. Generally for syntax error the code editor will highlight with a little red squiggle under the error and give you an indication of the problem when you hover over it.
Ah, I see, your strings are broken. You must espace the single quote characters that are part of your string.
Notice how the string goes from red to gray to blue seemingly randomly. That is because an unescaped single quote is ending the string prematurely.

https://cdn.discordapp.com/attachments/1133465166772707368/1133470894203871323/image.png

b
So I turn ‘’ into ()?
r
An option may be to replace the beginning and ending quotes with a backtick for string literals
Like this. Using `` instead of '' or "" around your strings. This how-to explains javascript strings nicely: https://www.freecodecamp.org/news/how-to-escape-strings-in-javascript/

https://cdn.discordapp.com/attachments/1133465166772707368/1133471646737502248/image.png

b
heres my code now, still says error
shit hold on let me screenshto discord is removing the backticks

https://cdn.discordapp.com/attachments/1133465166772707368/1133473210407604274/image.png

r
@bumpy-morning-51656 can you share a file with the code inside?
r
At a quick glance, that looks right @bumpy-morning-51656
r
code looks fine at 1st glance though
b
the botpress file or the code file?
r
maybe the if else that needs to be closer? (try removing the extra line between). Also, make sure there isn't a special character in there. Like copy/paste this in a notepad then copy/paste it back into the code editor to remove any invisible chars
r
A text file would be better. The PDF adds extra lines everywhere that breaks the code. Quick glance, still missing on lines 30. 34. 39 (39 isnt closed either.).
r
Line 30, there is a squiggle right under the end of the line. The string must be closed.

https://cdn.discordapp.com/attachments/1133465166772707368/1133484552850002040/image.png

b
that took way to long to figure out but thank you so much for helping me through it, now I know what to look for next time I get that message
I would hire a developer but I like learning how to use the program before I have someone else do it for me
h
Happy to know, I would love to contribute
2 Views