peh / grails-babel-asset-pipeline

babel.js transformation for grails-asset-pipeline
7 stars 2 forks source link

Rhino Error when using with asset-pipeline 2.13.1 plugin #14

Open robertoschwald opened 7 years ago

robertoschwald commented 7 years ago

After updating asset pipeline from 2.9.1 to 2.13.1 due to a critical filter bug, I receive the following error from Babel. Env: Grails 2.4.4, Oracle Java SDK 7, OSX 10.12.2

WAR packaging error: TypeError: org.mozilla.javascript.Undefined@1e83a64 is not a function, it is undefined. (file://.m2/repository/net/errbuddy/plugins/babel-asset-pipeline/1.4.5-java7/babel-asset-pipeline-1.4.5-java7.jar!/asset/pipeline/babel/env.rhino.js#2346)

peh commented 7 years ago

hey, could you provide a sample project where this is reproducable please?!

robertoschwald commented 7 years ago

I try to compile one

robertoschwald commented 7 years ago

Sample application see https://github.com/robertoschwald/sample_babel_issue_14

Note: This is a stock Grails 2.4.4 installation just with the plugins defined. No es6 file at all, but also shows the same error as within my project.

robertoschwald commented 7 years ago

For now, I backported some critical fixes into a asset-pipeline plugin 1.9.1 fork, so war building works in my project again. Unfortunately, these critical fixes are in asset-pipeline 2.13.1 only, therefore trying one of the versions in between does not help.

peh commented 7 years ago

perfect thank you. will check

robertoschwald commented 7 years ago

The error occurs using Java 8 SDK (tested here with .111 - see my sample project), and using Java 7 SDK (1.7.0_79) when using your babel-asset-pipeline 1.4.5-java7 dependency (which I do in my project, as it is Grails 2.4.4 which does not support Java8). So Java version seem not to be the culprit.

peh commented 7 years ago

hey, i think you forgot to push something https://github.com/robertoschwald/sample_babel_issue_14/blob/master/grails-app/conf/BuildConfig.groovy doesn't even have the this plugin installed ;)

robertoschwald commented 7 years ago
        compile ':asset-pipeline:2.13.1'
        compile ':less-asset-pipeline:2.13.1'
        compile "org.grails.plugins:babel-asset-pipeline:1.4.5"
peh commented 7 years ago

ah wait. intellij ran a create-app after importing the project.... i love it!

robertoschwald commented 7 years ago

Yeah. Intellij. Much trouble these days with it also in Grails 2 / 3 projects. Updating dependencies I figured out sometimes only starts when you switch to the Grails view...