Skip to content

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

Open
@pawelhalasa

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions