encouter a theme exception

I am testting demo project .
Then I switch vaadin version to 7.1.0.beta1 (previous is 7.0.5),and I hack demo project slightly (e.g. remove login page ,so first page is dashboard).
When I open dashboard page , css mess up and server console output exception below:

com.vaadin.sass.internal.expression.exception.ArithmeticException: Illegal arithmetic expression
at com.vaadin.sass.internal.expression.ArithmeticExpressionEvaluator.createExpression(ArithmeticExpressionEvaluator.java:102)
at com.vaadin.sass.internal.expression.ArithmeticExpressionEvaluator.evaluate(ArithmeticExpressionEvaluator.java:132)
at com.vaadin.sass.internal.tree.VariableNode.traverse(VariableNode.java:116)
at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:271)
at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:280)
at com.vaadin.sass.internal.ScssStylesheet.compile(ScssStylesheet.java:187)
at com.vaadin.server.VaadinServlet.serveOnTheFlyCompiledScss(VaadinServlet.java:767)
at com.vaadin.server.VaadinServlet.serveStaticResourcesInVAADIN(VaadinServlet.java:560)
at com.vaadin.server.VaadinServlet.serveStaticResources(VaadinServlet.java:530)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:191)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

And I find the class ArithmeticExpressionEvaluator.java was not in previous version of vaddin.

Can someone help me?

It looks like one line in common.scss file :
“$font: normal $font-size/1.5 “Open Sans”, Arial, sans-serif;”
cause the exception.
If I modify it like below:
$font: normal “Open Sans”, Arial, sans-serif;
the program can run properly.

Why ?

Thanks James, this saved me a lot of time looking for the problem!

Also, I found that if you modify the offending line to:

$font: normal 14px/1.5 “Open Sans”, Arial, sans-serif;

it works ok without breaking the fonts.

Regards

jim

Hi James, Jim

I’ve just updated my project to 7.1.0 and I got this same error, I’ve looked in my common.scss file though and it looks like the version I started with had your fix applied: $font: normal $font-size/1.5 "Open Sans", Arial, sans-serif; I’m assuming that this means I’ve got a problem somewhere else in my code. Any tips in troubleshooting it before I start crawling through my SCSS commenting out sections and includes?

Many thanks,

Andrew

When SASS arithmetics is supported (Vaadin 7.1), the slash is interpreted as division when variables are used (see also
the original SASS specification
).

I am not certain if #{} is already supported in this case with the Vaadin implementation, you could try using “#{$font-size}/1.5” .

Thanks Henri,

That change did help, I’m now onto a new error!

Many thanks!!

Andrew

It has occurred to me that it might be worth mentioning that my SCSS is based on the Vaddin Dashboard Demo SCSS, if anyone else used that SCSS as a base then you could have the same issue that I had.

Unfortunately while the code #{$font-size} is accepted by Vaadin, it doesn’t look like it is yet implemented. I had to replace this with 14px to get it to work.

Hope this helps anyone with a similar problem with the dashboard CSS.

I made a ticket about the issue:
http://dev.vaadin.com/ticket/12192

if you use dashboard demo theme, change in common.scss like this


$font: normal $font-size/1.5 “Open Sans”, Arial, sans-serif;


to

$font: normal 14px “Open Sans”, Arial, sans-serif;