require-handlebars-plugin icon indicating copy to clipboard operation
require-handlebars-plugin copied to clipboard

Helper paths being overwritten

Open benwalsh opened this issue 10 years ago • 1 comments

I am using requirejs-rails but I think the issue is not there, but here.

I have my Javascript app in a /app/assets/javascripts/fn/* directory. Handlebars is loading, the require-handlebars-plugin is loading, and my hbs templates are loading. But then the moduleTree encounters a helper, and it blows up:

{ [Error: Error: ENOENT, no such file or directory '/var/rails/myapp/releases/20150528174835/tmp/requirejs/dst/templates/helpers/t.js'
In module tree:
    some-file
      some-dependency
        hbs

But the file is not located at templates/helpers/t.js, it's located at fn/templates/helpers/t.js. I have even abstracted the direct call out; the JS file is including hbs-translation-helper, and in the requireJS config, that path is resolving to: "fn/templates/helpers/t". So why would it be looking in a top-level templates/ directory which isn't there?

I have tried setting:

hbs:
  helpers: false

but no luck.

benwalsh avatar May 28 '15 18:05 benwalsh

It defaults to templates/helpers but can be overwritten with requirejs.config.hbs.helperDirectory

chrisrink avatar Jul 10 '15 17:07 chrisrink