LoginSignup
0
0

More than 3 years have passed since last update.

PluginError [SyntaxError]: Unexpected token '.' in /project/filename.ejs while compiling ejs

Posted at

フォーマットを関数コール形式にする修正が必要になった。

<% include ./head.ejs %>

<%- include('./head.ejs') %>

# search
<% include( )([\w|\.|\/]*) %>
# replace
<%- include('$2') %>

# file to include 
*.ejs
PluginError [SyntaxError]: Unexpected token '.' in /project/filename.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 (/project/node_modules/gulp-ejs/node_modules/ejs/lib/ejs.js:662:12)
    at Object.compile (/project/node_modules/gulp-ejs/node_modules/ejs/lib/ejs.js:396:16)
    at handleCache (/project/node_modules/gulp-ejs/node_modules/ejs/lib/ejs.js:233:18)
    at Object.exports.render (/project/node_modules/gulp-ejs/node_modules/ejs/lib/ejs.js:423:10)
    at DestroyableTransform._transform (/project/node_modules/gulp-ejs/index.js:24:28)
    at DestroyableTransform.Transform._read (/project/node_modules/gulp-ejs/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at DestroyableTransform.Transform._write (/project/node_modules/gulp-ejs/node_modules/readable-stream/lib/_stream_transform.js:164:83)
    at doWrite (/project/node_modules/gulp-ejs/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (/project/node_modules/gulp-ejs/node_modules/readable-stream/lib/_stream_writable.js:398:5) {
  __safety: undefined,
  _stack: undefined,
  plugin: 'gulp-ejs',
  showProperties: true,
  showStack: false,
  fileName: '/project/filename.ejs'
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0