Skip to content

"TypeError: undefined is not a function" in generated file #17

Open
@martynbiz

Description

@martynbiz

Hi, I have the following HAML:

!!! 5
%html.no-js{:lang => "en"}
  %head
    %title Our Awesome Haml Template
  %body
    %p Abstracting HTML since 2006

But it's outputting the following error message in the generated file:

<pre class='error'>TypeError: undefined is not a function
    at eval (eval at &lt;anonymous&gt; (/Users/mbiz/www/suau/node_modules/haml/lib/haml.js:595:29), &lt;anonymous&gt;:2:15)
    at Function.&lt;anonymous&gt; (/Users/mbiz/www/suau/node_modules/haml/lib/haml.js:595:11)
    at execute (/Users/mbiz/www/suau/node_modules/haml/lib/haml.js:602:8)
    at Function.render (/Users/mbiz/www/suau/node_modules/haml/lib/haml.js:587:12)
    at hamlStream (/Users/mbiz/www/suau/node_modules/gulp-haml/index.js:31:6)
    at wrappedMapper (/Users/mbiz/www/suau/node_modules/map-stream/index.js:84:19)
    at Stream.stream.write (/Users/mbiz/www/suau/node_modules/map-stream/index.js:96:21)
    at write (/Users/mbiz/www/suau/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Users/mbiz/www/suau/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/Users/mbiz/www/suau/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)</pre>

It seems to work if I remove the {:lang => "en"} part, but I want to put a lang attribute here, so removing it is not an option.

Also, if it helps, here's how I'm declaring my gulpfile task:

gulp.task('haml', function () {
    return gulp.src('src/haml/**/*.haml')
        .pipe(haml({ext: '.html'}))
        // .pipe(prettify({indent_char: ' ', indent_size: 4}))
        .pipe(gulp.dest('./'));
});

Anyway, let me know if you need any more info :) Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions