Radomus Vanhanen
Radomus Vanhanen

Reputation: 11

SyntaxError: Unexpected identifier in index.ejs while compiling ejs

<body>
        <header>
            <% include templates/header.ejs %>
        </header>
            <% include templates/announcement.ejs %>
        <form>
            <br><input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search a fort...">
        </form><br>
        <section id="placeList">
            <div class="placeListBackground" id="placeListGet">
             <ul id="placeCells">
                <% placeData.forEach(function(placeData) { %>
                    <div class="placeContainer <%= placeData.category %>" class><a href = "https://www.roblox.com/games/<%= placeData.placeid %>/-"><img src= "<%= placeData.placeicon %>" alt="<%= placeData.placename %>" align="left" width="178" height="100"><span><%= placeData.placename %></span><p><%= placeData.clan %></p><p>Playing: <%= placeData.playing %></p><p class="sCategory"><%= placeData.category %></p></a></div>
                <% }); %>
             </ul>
            </div>
        </section>
        <br><footer>Contact us: https://discord.gg/fMb5y7T</footer>
    </body>
    <% include templates/search.ejs %>

I've checked through and tested a bunch of different tags for ejs just in-case but I do not see why this is not working. It worked previously but there must be some issue I'm overlooking unless it is the fault of ejs?

Upvotes: 1

Views: 1325

Answers (2)

Yunat Amos
Yunat Amos

Reputation: 99

try downgrading or upgrading ejs package

Upvotes: 0

Juan
Juan

Reputation: 11

I think the problem is with the ejs tags.

You have wrote: <% include templates/file.ejs %>

And should be: <%- include ("templates/file.ejs") %>

At least I had same problem and solved that way, I hope is usefull. look for more info about ejs changes: https://github.com/RyanZim/EJS-Lint

Upvotes: 1

Related Questions