Before filing issues, please check the following points first:
This will probably help you to get a solution faster.
For bugs, it would be great to have a PR with a failing test-case.
I can try and find a way to reproduce this, but to get it started in case it's somehow obvious. In 4.1.2 everything with the below helpers worked fine. In 4.2.0 I get "Missing helper: "far""... but it only seems to error when I'm instrumenting the code with istanbul.
However there are no other changes npm i [email protected] fixes the issue and @4.2.0 causes it again.
import _ from 'underscore';
import Handlebars from 'handlebars/runtime';
import { findIconDefinition, icon, config } from '@fortawesome/fontawesome-svg-core';
import '@fortawesome/fontawesome-svg-core/styles.css';
config.autoAddCss = false;
config.replacementClass = 'svg-inline--fa icon';
function faHelper(prefix, iconName, { hash = {} }) {
const faDefinition = findIconDefinition({ prefix, iconName });
const faIcon = icon(faDefinition, hash);
if (!faIcon || !faIcon.html) {
throw new Error(`${ prefix }:${ iconName } fontawesome icon not loaded`);
}
return new Handlebars.SafeString(faIcon.html);
}
// {{far "acorn"}} -> <svg ...>
Handlebars.registerHelper({
far: _.partial(faHelper, 'far'),
fas: _.partial(faHelper, 'fas'),
fal: _.partial(faHelper, 'fal'),
});
Before filing issues, please check the following points first:
This will probably help you to get a solution faster.
For bugs, it would be great to have a PR with a failing test-case.
I can try and find a way to reproduce this, but to get it started in case it's somehow obvious. In
4.1.2everything with the below helpers worked fine. In4.2.0I get"Missing helper: "far""... but it only seems to error when I'm instrumenting the code with istanbul.However there are no other changes
npm i [email protected]fixes the issue and@4.2.0causes it again.