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

Unified throws an error when a empty .html file is present. #30

Open
cpetta opened this issue Oct 9, 2019 · 1 comment
Open

Unified throws an error when a empty .html file is present. #30

cpetta opened this issue Oct 9, 2019 · 1 comment

Comments

@cpetta
Copy link
Owner

cpetta commented Oct 9, 2019

  1:1  error  Error: hast-util-to-nlcst expected position on nodes
    at toNlcst (C:\sandpaper\node_modules\hast-util-to-nlcst\index.js:66:11)
    at transformer (C:\sandpaper\node_modules\rehype-retext\index.js:32:16)
    at wrapped (C:\sandpaper\node_modules\trough\wrap.js:25:19)
    at next (C:\sandpaper\node_modules\trough\index.js:57:24)
    at Object.run (C:\sandpaper\node_modules\trough\index.js:31:10)
    at executor (C:\sandpaper\node_modules\unified\index.js:295:20)
    at Function.run (C:\sandpaper\node_modules\unified\index.js:292:5)
    at transform (C:\sandpaper\node_modules\unified-engine\lib\file-pipeline\transform.js:14:23)
    at wrapped (C:\sandpaper\node_modules\trough\wrap.js:25:19)
    at next (C:\sandpaper\node_modules\trough\index.js:57:24)

× 1 error
C:\sandpaper\node_modules\async-done\index.js:18
    throw err;
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
  uid: 8,
  name: 'lintHtmlContent',
  branch: false,
  error: Error: premature close
      at onclosenexttick (C:\sandpaper\node_modules\end-of-stream\index.js:53:86)
      at processTicksAndRejections (internal/process/task_queues.js:75:11),
  duration: [ 0, 173272219 ],
  time: 1570644121417
})
    at Gulp.emit (events.js:199:17)
    at Gulp.EventEmitter.emit (domain.js:476:20)
    at Object.error (C:\sandpaper\node_modules\undertaker\lib\helpers\createExtensions.js:61:10)
    at handler (C:\sandpaper\node_modules\now-and-later\lib\mapSeries.js:47:14)
    at f (C:\sandpaper\node_modules\once\once.js:25:25)
    at f (C:\sandpaper\node_modules\once\once.js:25:25)
    at tryCatch (C:\sandpaper\node_modules\async-done\index.js:24:15)
    at DestroyableTransform.done (C:\sandpaper\node_modules\async-done\index.js:40:12)
    at DestroyableTransform.f (C:\sandpaper\node_modules\once\once.js:25:25)
    at onclosenexttick (C:\sandpaper\node_modules\end-of-stream\index.js:53:73) {
  context: {
    uid: 8,
    name: 'lintHtmlContent',
    branch: false,
    error: Error: premature close
        at onclosenexttick (C:\sandpaper\node_modules\end-of-stream\index.js:53:86)
        at processTicksAndRejections (internal/process/task_queues.js:75:11),
    duration: [ 0, 173272219 ],
    time: 1570644121417
  }
}
@cpetta
Copy link
Owner Author

cpetta commented Oct 9, 2019

The function that the error originates from:

function lintHtmlContent() {
	return gulp.src(paths.src.html)
		.pipe(
			engine({name: 'gulp-unified', processor: require('unified')})()
				.use(parse)
				.use(
					rehype2retext,
					unified()
						.use([unifiedPlugins])
						.use(quotes, {preferred: 'straight'})
				)
				.use(stringify)
		);
}

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

1 participant