fbrctr / fabricator

A tool for building website UI toolkits and style guides
http://fbrctr.github.io/
MIT License
1.11k stars 124 forks source link

Moving or deleting components, stuctures and views causes cannot GET / page #257

Closed nathannash closed 8 years ago

nathannash commented 8 years ago

Hello, on npm start I receive the following error:

Error (fabricator-assemble): You must pass a string or Handlebars AST to Handlebars.compile. You passed undefined

Which is preceded by this:

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

I don't really know enough about code to troubleshoot this issue on my own. All I can tell from this is that there are errors on the above pages. Unfortunately I don't know how to go about resolving them since I haven't made changes (knowingly) to them.

Any help would be appreciated.

nathannash commented 8 years ago

If I reinstall a new fabricator project the overview page at localhost:3000 will load but as soon as I start moving HTML files in /src/materials/components/ it will throw errors.

LukeAskew commented 8 years ago

Try clearing out the contents of materials/structures/form.html.

You may be getting this error because form.html is referencing a component, but you've moved that component so the reference is no longer valid.

nathannash commented 8 years ago

Hi, thanks for taking some time to help. I've tried your suggestion but it hasn't resolved the issue.

I've installed node and npm on my windows host (original issue was on linux VM) and I get the same issue as above. Any time I delete a file in materials\components fabricator seems to break.

nathannash commented 8 years ago

After playing around some more and reinstalling a few times your original solution ended up resolving the issue. I had to completely remove the lines referencing components such as this one:

{{#each materials.structures.items}}
{{> f-item this}}
{{/each}}

from views\structures.html and views\pages\home.html. Thanks for your help.