Skip to content
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

Asset compilation fails on require('moment') #380

Open
pawelhalasa opened this issue Nov 10, 2016 · 2 comments
Open

Asset compilation fails on require('moment') #380

pawelhalasa opened this issue Nov 10, 2016 · 2 comments

Comments

@pawelhalasa
Copy link

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.

@davydotcom
Copy link
Contributor

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.

@parizpe1
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants