New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import from LESS files in web-app/less can't find plugin files #3
Comments
I experience the same thing during startup (run-app) after clean. If I touch ApplicationResources to get resources regenerated, it works. |
I also experience the same issue during startup. After that when I reload the problematic resources (by editing it), it works again. I guess it is due to the resources in the plugins are not ready during startup. Maybe this plugin should delay its process after other plugins are ready. |
By the way, any quick fix/ workaround exists to prevent this issue in current stage? |
I cannot recreate it. Could you prepare stacktrace with debug log. sammyhk notifications@github.com pisze:
|
Step to reproduce the issue: modules = {
application {
// dependsOn("bootstrap") // adding or removing this dependency cause the same issue
resource(
url: [dir: "less", file: "custom-bootstrap.less"],
attrs: [rel: "stylesheet/less", type: "css"]
)
}
} And the web-app/less/custom-bootstrap.less: @import "bootstrap.less";
@color: green;
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-color: @color;
} And included this resource in layout/main.gsp: ...
<head>
...
<r:require module="application" />
...
</head> When starting up the server, it throw an exception:
After that, when I reload the resource by touching the custom-bootstrap.less, it works as expected:
|
I got the described problem because the less files need to be compiled all at the same time not one after each other. |
The simple example from the bootstrap plugin fails with a Malformed URI exception because the path searched for imported files does not include the plugin path.
To reproduce, just follow the steps in the bootstrap plugin for customizing.
resource url:[dir: 'less', file: 'custom-bootstrap.less'], attrs:[rel: "stylesheet/less", type:'css']
The compilation of the custom-bootstrap.less file fails:
| Error 2012-04-20 21:06:42,702 [pool-5-thread-1] ERROR resourceMappers.LessResourceMapper - Error compiling less file: /home/along/.grails/2.0.3/projects/boottest/tomcat/work/Tomcat/localhost/boottest/grails-resources/less/custom-bootstrap.less
Message: object Object
The problem seems to be that the "paths" searched in the resolveUri() method only includes the web-app/less directory for the application and not the web-app/less directory for the plugin. That method loops and tries to resolve a URI for the given paths, and if not found, returns null which results in the error above.
The text was updated successfully, but these errors were encountered: