javascript - Gulp jade compilation -
i'm using gulp-jade , i'm getting error 1 of templates:
557| 558| > 559| 560| .tabs-wrap(ng-show="eventexists"): .contain-center 561| 562| #room-tabs-contain.contain-disable.contain: .contain-center unexpected token "pipeless-text" @ parser.parseexpr (/users/dylan/project/node_modules/jade/lib/parser.js:254:15)
at first glance appears error in github.com/jadejs/jade. might be, using jade server templates express, , when going through express router, template complies fine no errors.
i tried being explicit jade instance gets used gulp:
gulpjade = require 'gulp-jade' jade = require 'jade' locals = {} gulp.src "#{config.client}/**/*.jade" .pipe gulpjade(jade: jade, pretty: true, locals: locals) .pipe gulp.dest("#{config.build}")
still, no luck. key question trying figure out is:
- why jade template render fine through express, errors out when going through
gulp-jade
turns out, wrong. wasn't rendering template express.
the correct solution, , errors templates experiencing due changes between jade 1.9 , 1.11
example 1
- commenting out
.col-sm-3.text-right
div
bad
//- .col-sm-3.text-right
good
//- .col-sm-3.text-right
example 2
- the
img
element should visible,.col-sm-3.text-right
div should commented out
bad
img(src="/image-path/png", alt="someimage") //- .col-sm-3.text-right
good
img(src="/image-path/png", alt="someimage") //- .col-sm-3.text-right
Comments
Post a Comment