За последние 24 часа нас посетили 20565 программистов и 1102 робота. Сейчас ищут 354 программиста ...

ejs шаблон не работает

Тема в разделе "JavaScript и AJAX", создана пользователем riaron, 21 сен 2020.

  1. riaron

    riaron Активный пользователь

    С нами с:
    1 окт 2014
    Сообщения:
    247
    Симпатии:
    4
    Ejs Выдаетт ошибку
    SyntaxError: Unexpected token 'catch' in C:\xampp\htdocs\mysite.local\views\index.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 (C:\xampp\htdocs\mysite.local\node_modules\ejs\lib\ejs.js:661:12)
    at Object.compile (C:\xampp\htdocs\mysite.local\node_modules\ejs\lib\ejs.js:396:16)
    at handleCache (C:\xampp\htdocs\mysite.local\node_modules\ejs\lib\ejs.js:233:18)
    at tryHandleCache (C:\xampp\htdocs\mysite.local\node_modules\ejs\lib\ejs.js:272:16)
    at View.exports.renderFile [as engine] (C:\xampp\htdocs\mysite.local\node_modules\ejs\lib\ejs.js:489:10)
    at View.render (C:\xampp\htdocs\mysite.local\node_modules\express\lib\view.js:135:8)
    at tryRender (C:\xampp\htdocs\mysite.local\node_modules\express\lib\application.js:640:10)
    at Function.render (C:\xampp\htdocs\mysite.local\node_modules\express\lib\application.js:592:3)
    at ServerResponse.render (C:\xampp\htdocs\mysite.local\node_modules\express\lib\response.js:1012:7)
    Код (Javascript):
    1.   <% for(var smart in smartphopneList){ %>
    2.               <tr>
    3.                 <td class="leftitem" style="padding:10px;border-left:1px solid silver;border-top:1px solid silver;border-bottom:1px solid silver;">
    4.                     'Производитель: '<%= smart.prod %>
    5. ]            </td>
    6.             <td class="rightitem" style="border-top:1px solid silver;border-bottom:1px solid silver;"></td>
    7.             <td style="text-align:center;border-right:1px solid silver;border-top:1px solid silver;border-bottom:1px solid silver;">
    8.               <p><a href="/somesmart/" style="color:white;background-color:orange;padding:4px;border-radius:3px;font-weight:bold;">Подробнее</a></p>
    9.               <p><a href="/basket/" style="color:white;background-color:green;padding:4px;border-radius:3px;font-weight:bold;">В Корзину</a></p>
    10.             </td>
    11.           </tr> }
     
  2. Dimon2x

    Dimon2x Старожил

    С нами с:
    26 фев 2012
    Сообщения:
    2.199
    Симпатии:
    184
    возможно какая-то конструкция не закрыта