Skip to content

Unbuffered Code Issue with variables declared at beginning of pug template when using loader #127

@Tanisha0494

Description

@Tanisha0494

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:

- var accessories_selected = !{accessories_selected};
- var plan_selected = !{plan_selected};
- var dateNow = new Date();
- var dd = dateNow.getDate();
- var monthSingleDigit = dateNow.getMonth() + 1, mm = monthSingleDigit < 10 ? '0' + monthSingleDigit : monthSingleDigit;
- var yy = dateNow.getFullYear().toString().substr(2);
- var formattedDate = mm + '/' + dd + '/' + yy;

p(style='text-align: center')
  b Testy test test

ul
    br 
    - for(var i=0; i > accessories_selected.length; i++){
        span #{accessories_selected[i].name}
        li #{accessories_selected[i].description}
    - }

Any help would be much appreciated.

Thanks in advance for the help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions