bertramdev / grails-asset-pipeline

Grails Asset Pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asset compilation fails on require('moment')

pawelhalasa opened this issue · comments

commented

In the project I use number of JS plugins dependent on moment.js library. Some of them (e.g. Pikaday, Angular datepicker or Bootstrap daterangepicker) try to load moment.js module with requireJS using the following code
require('moment')

Since Grails Asset Pipeline 2.10.0 this particular code causes that my build fails with error:

Execution failed for task ':Consult:assetCompile'.
> Cannot cast object '[Digest Input Stream] MD5 Message Digest from SUN, <initialized>
  ' with class 'java.security.DigestInputStream' to class 'java.io.ByteArrayInputStream'

Everything works fine with asset pipeline version 2.9.5 and older. Also other uses of require function in JS code - e.g. require('jquery') - do not cause any issues.

Use latest 2.11.6

Sent from my iPhone

On Nov 10, 2016, at 5:25 AM, Pawel notifications@github.com wrote:

In the project I use number of JS plugins dependent on moment.js library. Some of them (e.g. Pikaday, Angular datepicker or Bootstrap daterangepicker) try to load moment.js module with requireJS using the following code
require('moment')

Since Grails Asset Pipeline 2.10.0 this particular code causes that my build fails with error:

Execution failed for task ':Consult:assetCompile'.

Cannot cast object '[Digest Input Stream] MD5 Message Digest from SUN,
' with class 'java.security.DigestInputStream' to class 'java.io.ByteArrayInputStream'
Everything works fine with asset pipeline version 2.9.5 and older. Also other uses of require function in JS code - e.g. require('jquery') - do not cause any issues.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

I'm using 2.11.6 and mine fails too:
Execution failed for task ':assetCompile'.

Cannot cast object '[Digest Input Stream] MD5 Message Digest from SUN,
' with class 'java.security.DigestInputStream' to class 'java.io.ByteArrayInputStream'