Open Tanisha0494 opened 4 years ago
@Tanisha0494 Can you share your webpack config?
Two years later...
@Tanisha0494 I corrected your sample and it work fine:
-
var accessories_selected = [
{name: 'aaa', description: 'desc1'},
{name: 'bbb', description: 'desc2'},
{name: 'ccc', description: 'desc3'},
],
dateNow = new Date(),
dd = dateNow.getDate(),
monthSingleDigit = dateNow.getMonth() + 1,
mm = monthSingleDigit < 10 ? '0' + monthSingleDigit : monthSingleDigit,
yy = dateNow.getFullYear().toString().substr(2),
formattedDate = mm + '/' + dd + '/' + yy;
p
b Date
span : #{formattedDate}
ul
each item in accessories_selected
li
span #{item.name}:
span #{item.description}
Your error was at first line: - var accessories_selected = !{accessories_selected};
, this destroy the array.
Lol yea I no longer need this. I figured it out.
Thanks though.
On Wed, Nov 3, 2021, 12:35 PM webdiscus @.***> wrote:
Two years later...
@Tanisha0494 https://github.com/Tanisha0494 I corrected your sample and it work fine:
- var accessories_selected = [ {name: 'aaa', description: 'desc1'}, {name: 'bbb', description: 'desc2'}, {name: 'ccc', description: 'desc3'}, ], dateNow = new Date(), dd = dateNow.getDate(), monthSingleDigit = dateNow.getMonth() + 1, mm = monthSingleDigit < 10 ? '0' + monthSingleDigit : monthSingleDigit, yy = dateNow.getFullYear().toString().substr(2), formattedDate = mm + '/' + dd + '/' + yy; p b Date span : #{formattedDate} ul each item in accessories_selected li span #{item.name}: span #{item.description}
Your error was at first line: - var accessories_selected = !{accessories_selected};, this destroy the array.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pugjs/pug-loader/issues/127#issuecomment-959867807, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMF4M76PL3JODJT36DFGT3UKGFGXANCNFSM4OSWGBQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
So the issue I'm having is when I try and debug / run my code I get this error:
SyntaxError: Unexpected token 'var'
I have my doc set up correctly. I tested in the sublime text editor it has a pug-lint extension and it runs perfectly.
Here's the code It's getting hung up on:
Any help would be much appreciated.
Thanks in advance for the help.