This is the message that I’m getting,
SyntaxError: Unexpected token } in /workspace/YelpCamp/v10/views/campgrounds/show.ejs while compiling ejs
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass `async: true` as an option.
at new Function (<anonymous>)
at Template.compile (/workspace/YelpCamp/v10/node_modules/ejs/lib/ejs.js:662:12)
at Object.compile (/workspace/YelpCamp/v10/node_modules/ejs/lib/ejs.js:396:16)
at handleCache (/workspace/YelpCamp/v10/node_modules/ejs/lib/ejs.js:233:18)
at tryHandleCache (/workspace/YelpCamp/v10/node_modules/ejs/lib/ejs.js:272:16)
at View.exports.renderFile [as engine] (/workspace/YelpCamp/v10/node_modules/ejs/lib/ejs.js:489:10)
at View.render (/workspace/YelpCamp/v10/node_modules/express/lib/view.js:135:8)
at tryRender (/workspace/YelpCamp/v10/node_modules/express/lib/application.js:640:10)
at Function.render (/workspace/YelpCamp/v10/node_modules/express/lib/application.js:592:3)
at ServerResponse.render (/workspace/YelpCamp/v10/node_modules/express/lib/response.js:1012:7)
at /workspace/YelpCamp/v10/routes/campgrounds.js:57:8
at /workspace/YelpCamp/v10/node_modules/mongoose/lib/model.js:4863:16
at /workspace/YelpCamp/v10/node_modules/mongoose/lib/helpers/promiseOrCallback.js:24:16
at /workspace/YelpCamp/v10/node_modules/mongoose/lib/model.js:4886:21
at _hooks.execPost (/workspace/YelpCamp/v10/node_modules/mongoose/lib/query.js:4397:11)
at /workspace/YelpCamp/v10/node_modules/kareem/index.js:136:16
Here is my show.ejs
file,
<%- include("../partials/header")%>
<div class="container">
<div class="row">
<div class="col-md-3">
<p class="lead">YelpCamp</p>
<div class="list-group">
<li class="list-group-item active">Info 1</li>
<li class="list-group-item">Info 2</li>
<li class="list-group-item">Info 3</li>
</div>
</div>
<div class="col-md-9">
<div class="thumbnail">
<img class="img-responsive" src="<%=campground.image%>">
<div class="caption-full">
<h4 class="pull-right">$9.00/Night</h4>
<h4><a><%=campground.name%></a></h4>
<p><%= campground.description %></p>
<p>
<em>Submitted By -<%= campground.author.username %></em>
</p>
<% if(currentUser && campground.author.id.equals(currentUser._id)){ %>
<a class="btn btn-xs btn-warning" href="/campgrounds/<%= campground._id %>/edit">Edit</a>
<form id="delete-form" action="/campgrounds/<%= campground._id %>?_method=DELETE" method="POST">
<button class="btn btn-xs btn-danger">Delete</button>
</form>
<% } %>
</div>
</div>
<div class="well">
<div class="text-right">
<a class="btn btn-success" href="/campgrounds/<%= campground._id %>/comments/new">Add new Comment</a>
</div>
<hr>
<% campground.comments.forEach(function(comment){ %>
<div class="row">
<div class="col-md-12">
<strong><%= comment.author.username.toUpperCase() %></strong>
<span class="pull-right">10 days ago</span>
<p>
<%= comment.text %>
</p>
<a class="btn btn-xs btn-warning"
href="/campgrounds/<%= campground._id %>/comments/<%= comment._id %>/edit">
Edit
</a>
<form class="delete-form" action="/campgrounds/<%= campground._id %>/comments/<%= comment._id %>?_method=DELETE" method="POST">
<input type="submit" class="btn btn-xs btn-danger" value="Delete">
</form>
</div>
</div>
<%- }) %>
</div>
</div>
</div>
</div>
<%- include("../partials/footer")%>
Is there any error in my ejs syntax or something else?