ejs
ejs copied to clipboard
sometimes parse error with <%- func('str') %>
node version:v8.15.1 express version:~4.14.0 ejs version:~2.3.3
When using express + ejs , we found that sometimes ejs parse cause error ( not always ) in production mode but don't know why. Is there any suggestion that handle with the error?thanks much!
error messages here.
/app/routes/hd/singerVote/vote.ejs:7
0|manhua_h | 5| <!-- banner -->
0|manhua_h | 6| <section class="s-banner">
0|manhua_h | >> 7| <img src="<%- getStatic('res/img/hd/singer_vote/banner-vote.png') %>" />
0|manhua_h | 8| <i class="icon-share"></i>
0|manhua_h | 9| <span class="time"><%= resource.list_time %></span>
0|manhua_h | 10| </section>
0|manhua_h |
0|manhua_h | Cannot read property 'replace' of undefined
0|manhua_h | at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:464:12), <anonymous>:176:36)
0|manhua_h | at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:464:12), <anonymous>:191:9)
0|manhua_h | at returnedFn (/app/node_modules/ejs/lib/ejs.js:493:17)
0|manhua_h | at include (/app/node_modules/ejs/lib/ejs.js:491:39)
0|manhua_h | at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:464:12), <anonymous>:38:16)
0|manhua_h | at returnedFn (/app/node_modules/ejs/lib/ejs.js:493:17)
0|manhua_h | at View.exports.renderFile [as engine] (/app/node_modules/ejs/lib/ejs.js:350:31)
0|manhua_h | at View.render (/app/node_modules/express/lib/view.js:126:8)
0|manhua_h | at tryRender (/app/node_modules/express/lib/application.js:639:10)
0|manhua_h | at Function.render (/app/node_modules/express/lib/application.js:591:3) path: '/app/routes/tpl.ejs' }