Closed kaspar-allenbach closed 6 years ago
Using Node v8.9.3 and Handlebars v4.0.11 this is working fine for me:
const handlebars = require('handlebars');
const layouts = require('../dist/handlebars-layouts');
handlebars.registerHelper(layouts(handlebars));
console.log(handlebars.helpers);
Can you share the entire error with stack trace?
It's interesting to me that your example error has Handlebars
(uppercase "H") and not handlebars
(lowercase "h"). Is it possible you have a case error in your actual code?
omg 😫 yes that uppercase H
was the problem.
This is not partucular a problem of your npm package. I run into this regularely :(
I import handlebars with the standard require code for npm:
This throws the error:
I can only include it with this:
other npm packages work with with the require command just fine
E.g. this works
var c3 = require("c3");
But why?