Not pulling in partials or data (when path contains a space)
See original GitHub issueI 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:
- Created 7 years ago
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Updated to 5.1.4; working like a charm. Thanks!
Released 5.1.4 which resolves this issue.