sheehan/grails-handlebars-resources

Fails to bundle up the handlebar resource

Closed this issue · 2 comments

I ran into the below issue

INFO: Initializing Spring root WebApplicationContext
| Error 2013-07-23 02:13:15,063 [localhost-startStop-1] ERROR handlebars.HandlebarsResourceMapper  - error precompiling
handlebars file: C:\Users\dipayan.b\.grails\2.2.3\projects\testapp\tomcat\work\Tomcat\localhost\testapp\grails-resources
\bundle-handlebars_defer.js
Message: D:\personalwork\grails-workspace\testapp\web-app\bundle-handlebars_defer.js, \templates\person.handlebars (The
system cannot find the path specified)
    Line | Method
->>  138 | <init>                        in java.io.FileInputStream
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|     43 | precompile                    in org.grails.plugin.handlebars.Precompiler
|     36 | map . . . . . . . . . . . . . in org.grails.plugin.handlebars.HandlebarsResourceMapper
|    139 | invoke                        in org.grails.plugin.resource.mapper.ResourceMapper
|    128 | invokeIfNotExcluded . . . . . in     ''
|    590 | applyMappers                  in org.grails.plugin.resource.ResourceProcessor
|    535 | prepareResource . . . . . . . in     ''
|    610 | doCall                        in org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_
closure12
|     29 | addDeclaredResource . . . . . in org.grails.plugin.resource.util.ResourceMetaStore
|    608 | prepareSingleDeclaredResource in org.grails.plugin.resource.ResourceProcessor
|    657 | prepareResourceBatch . . . .  in     ''
|    813 | resourcesChanged              in     ''
|    809 | loadModules . . . . . . . . . in     ''
|   1078 | reloadAll                     in     ''
|    172 | doCall . . . . . . . . . . .  in ResourcesGrailsPlugin$_closure3
|    334 | innerRun                      in java.util.concurrent.FutureTask$Sync
|    166 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
|   1145 | runWorker                     in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    724 | run                           in java.lang.Thread
| Server running. Browse to http://localhost:8080/testapp

ApplicationResources.groovy file content is given below:

modules = {
    application {
        dependsOn 'handlebars_runtime'
        resource url: 'templates/person.handlebars', attrs: [type: 'js'], bundle: 'handlebars'
        resource url:'js/application.js'
    }
}

BuildConfig.groovy

plugins {
        runtime ":hibernate:$grailsVersion"
        runtime ":jquery:1.8.3"
        runtime ":resources:1.2"

        // Uncomment these (or add new ones) to enable additional resources capabilities
        //runtime ":zipped-resources:1.0"
        //runtime ":cached-resources:1.0"
        //runtime ":yui-minify-resources:0.1.5"

        build ":tomcat:$grailsVersion"

        runtime ":database-migration:1.3.2"

        compile ':cache:1.0.1'
        runtime ':handlebars-resources:0.3.6'
    }

Grails version : 2.2.3

This is now fixed in version 1.0.

Please check pull request 14 as I believe it fixes another case that causes this issue.