-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unbuffered Code Issue with variables declared at beginning of pug template when using loader #127
Comments
@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: |
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
<#127 (comment)>,
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>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: