fbrctr / fabricator-assemble

The assembly engine behind Fabricator
39 stars 49 forks source link

v1.1.11: You must pass a string or Handlebars AST to Handlebars.compile. #40

Open PierreGUI opened 8 years ago

PierreGUI commented 8 years ago

Since version 1.1.11 I have an error when assembling (see below). Worked fine with v1.1.10, my architecture is something like:

src
    materials
        components
            01-logos
                01-logo-dark
                02-logo-light
            02-whatever
                01-something
                02-something-else

As I was looking to find the reason behind it, turns out the error is gone when removing the numbers in front on the first level folder of the component, ie: 01-logos becomes 'logos' and so on...

Reverting commit d52fad98c35436ec244d8de97d7adb4d6000e7d2 works great. I guess the regex is not the one yet... :)

The error I'm talking about:

Error (fabricator-assemble): You must pass a string or Handlebars AST to Handlebars.compile. You passed undefined
 Error: You must pass a string or Handlebars AST to Handlebars.compile. You passed undefined
    at Object.compile (.../node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:464:11)
    at HandlebarsEnvironment.hb.compile (.../node_modules/handlebars/dist/cjs/handlebars.js:38:41)
    at Object.<anonymous> (.../node_modules/fabricator-assemble/index.js:562:20)
    at Object.eval (eval at createFunctionContext (.../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:221:23), <anonymous>:9:78)
    at Object.ret (.../node_modules/handlebars/dist/cjs/handlebars/runtime.js:159:30)
    at Object.ret [as f-item-content] (.../node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:488:21)
    at Object.invokePartialWrapper [as invokePartial] (.../node_modules/handlebars/dist/cjs/handlebars/runtime.js:65:46)
    at Object.eval (eval at createFunctionContext (.../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:221:23), <anonymous>:12:23)
    at prog (.../node_modules/handlebars/dist/cjs/handlebars/runtime.js:193:15)
    at execIteration (.../node_modules/handlebars/dist/cjs/handlebars/base.js:155:19)
alienlebarge commented 8 years ago

Same here. After a downgrade to 1.1.10 everything seams OK.

alienlebarge commented 8 years ago

Can it be a problem with the regex ? See #31