Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no writecb in Transform class #35

Open
viktor-yakubiv opened this issue Sep 15, 2015 · 6 comments
Open

no writecb in Transform class #35

viktor-yakubiv opened this issue Sep 15, 2015 · 6 comments

Comments

@viktor-yakubiv
Copy link

I have an issue with compiling slim.

My code looks like this:

var gulp = require('gulp');
var plugins = require('gulp-load-plugins')({scope: ['devDependencies']});

gulp.task('html', function () {
  return gulp.src('slim/**/*.slim')
    .pipe(plugins.slim())
    .pipe(gulp.dest('dist/views'));
});

Error goes here:

[19:07:24] Starting 'html'...
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: no writecb in Transform class
    at afterTransform (D:\Develop\bootstrap-wdk\node_modules\gulp-slim\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:95:33)
    at TransformState.afterTransform (D:\Develop\bootstrap-wdk\node_modules\gulp-slim\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:79:12)
    at Socket.<anonymous> (D:\Develop\bootstrap-wdk\node_modules\gulp-slim\index.js:124:18)
    at emitNone (events.js:72:20)
    at Socket.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:893:12)
    at doNTCallback2 (node.js:429:9)
    at process._tickCallback (node.js:343:17)

I think this was resolved here, but I don't understand it.
sindresorhus/gulp-esnext#8

@yozzh
Copy link
Collaborator

yozzh commented Sep 15, 2015

Can you show me your slim-file?

@viktor-yakubiv
Copy link
Author

It look like this.

<!DOCTYPE html>
html lang="en"
head
  meta charset="UTF-8"/
  title Document
body

I have add some changes and don't remember what it was. There was autogenerated slim code by Emmet (command "!" without braces).

@yozzh
Copy link
Collaborator

yozzh commented Sep 15, 2015

You have a syntax errors in your slim file:

  1. Slim generates doctype with this construction:
    doctype html
  2. You have wrong indentation of head and body tags. They must be inside html tag.
    Try to fix it and reply with results.

@viktor-yakubiv
Copy link
Author

No. It is not important.
Slim code is valid. Bad indented code will compiles with another nesting only, e.x.:

<!doctype html>
html
head
body

compiles to

<!DOCTYPE html>
<html></html>
<head></head>
<body></body>

I tried to run slimrb * from slim directory and have no errors, good output. When I changes my file, it have no errors, just compile with some unexpectedly.

I have test this task with different code. For example:

doctype html
html lang="en"

This code is valid slim, but causes the same error.

@jossiwolf
Copy link

Same issue here, what can I do?

<!doctype html>
html
head
body

This code is working fine.

@ekiziltas
Copy link

Same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants