Search code examples
javascriptbackbone.jsgruntjsmustache

jst:compile destination not written because compiled files were empty


I got this error after NetBeans crashed while working with Backbone and Mustache templating. I use "grunt server" to load and test the application.

In the console (chrome) I get the following error:

Uncaught TypeError: Cannot read property 'app/scripts/templates/App.mustache' of undefined

Any hints would be appreciated! Thanks!


Solution

  • At the end I found what I was doing wrong. I'll post my solution, in case someone happens to have the same problem.

    I had everything correctly installed, and I was using yeoman as scaffolder, but when I created the project I did:

    yo backbone
    

    Instead, if you plan to use 'mustache' templates, you should scaffold the project using:

    yo backbone --template-framework=mustache
    

    Here is the reference https://github.com/yeoman/generator-backbone