question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not pulling in partials or data (when path contains a space)

See original GitHub issue

I have the following gulp task setup.

gulpfile.js

gulp.task('html', function() {

    return gulp.src('./src/html/*.{hbs,html}')
        .pipe(hb({
            data: [
                './src/html/data/*.json'
            ],
            partials: [
                './src/html/partials/*.{hbs,html}'
            ]
        }))
        .pipe(gulp.dest('./dist'));

});

src/html/data/var.json

{
    "title": "Test boom!"
}

src/html/data-test.html

{{ title }}
{{ var.title }}
{{ @var.title }}

src/html/partial-test.html

{{> boom }}
{{> show message="boom boom" }}

src/html/partials/boom.hbs

hi

src/html/partials/show.hbs

{{ message }}

With the data, the file returns empty and the partials returns this error.

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: The partial boom could not be found
    at Object.invokePartial (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/handlebars/dist/cjs/handlebars/runtime.js:266:11)
    at Object.invokePartialWrapper [as invokePartial] (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/handlebars/dist/cjs/handlebars/runtime.js:68:39)
    at Object.eval (eval at createFunctionContext (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:8:28)
    at main (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32)
    at ret (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12)
    at ret (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21)
    at /Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/handlebars-wax/src/handlebars-wax.js:202:10
    at DestroyableTransform._transform (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/gulp-hb/src/gulp-hb.js:94:31)
    at DestroyableTransform.Transform._read (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/Users/neil/Dropbox (Personal)/Code/email-builder/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)

Really confused what I’m doing wrong 😕

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ry5ncommented, Sep 26, 2016

Updated to 5.1.4; working like a charm. Thanks!

0reactions
shannonmoellercommented, Sep 26, 2016

Released 5.1.4 which resolves this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loading files in a Java ist not working when path contains any ...
Just stop treating classpath resource URLs as file paths. Do the correct thing, and it will work fine. Return a URL, or an...
Read more >
How to fix "The image path must not contain any spaces ...
ADDITION:Also delete the spaces from the folder name which contain the ISO file !!!Bad path example:C:\folder name\file name.
Read more >
How to call a program that contains space in filename?
This answer is only a partial solution: It will work if there are spaces in the path but it will not work if...
Read more >
How to write the path of a folder with space in its name?
I can't figure out how to write the path of a folder that includes spaces in its name (in Terminal). I tried: cd...
Read more >
Add links containing spaces to an e-mail message
Note: If you insert the link by using the Hyperlink command, then no truncation occurs. In a new message, on the Insert tab,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found