greenlaw110 / greenscript

A tool help web developers manage javascript/css rendering, including minimize and dependence management
42 stars 24 forks source link

Greenscript not loaded when 404 happens #10

Open Pyppe opened 13 years ago

Pyppe commented 13 years ago

HOW TO REPRODUCE:

My app/views/errors/404.html is as follows:

{extends 'main.html' /}

#{set title:'Page not found (HTTP 404)' /}
<h1>Page not found</h1>

<p>Ooops... page is not here.</p>

And the main.html uses these greenscript definitions:

{greenscript.css 'jquery-ui/jquery-ui-1.8.7.custom main', output:'all'/}

#{greenscript.js 'jquery.kuntokanta jquery.json-2.2.min jquery.form-2.61.min jquery.cookie', output:'all' /}

These work fine with normal use-cases when page is found. It even works, if I explicitly set notFound() in my controller. But it does not work, if the Play framework itself "causes" that Not Found -page.

travelstep commented 12 years ago

Has this been resolved?

I get the same behaviour in test mode; Minimized CSS is not loaded. In production mode and in Jetty I get the following exception:

Template execution error (In {module:greenscript-1.2.6k}/app/views/tags/greenscript/gs.html around line 23) Execution error occured in template {module:greenscript-1.2.6k}/app/views/tags/greenscript/gs.html. Exception raised was NullPointerException : Cannot invoke method declare() on null object.

play.exceptions.TemplateExecutionException: Cannot invoke method declare() on null object at play.templates.BaseTemplate.throwException(BaseTemplate.java:84) at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:252) at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:374) at {module:greenscript-1.2.6k}/app/views/tags/greenscript/css.html.(line:1) at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:229) at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:374) at /app/views/main.html.(line:12) at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:229) at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:262) at play.templates.Template.render(Template.java:26) at play.templates.GroovyTemplate.render(GroovyTemplate.java:184) at play.server.PlayHandler.serve500(PlayHandler.java:707) at Invocation.HTTP Request(Play!) Caused by: java.lang.NullPointerException: Cannot invoke method declare() on null object at {module:greenscript-1.2.6k}/app/views/tags/greenscript/gs_.html.(line:23) at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:229) ... 11 more

jonathonadler commented 12 years ago

This still seems to be an issue. I haven't been able to track down the cause yet