bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
192 stars 90 forks source link

v3.4.0: toFlatConfig() is applicable for argument types: () values: [] #295

Open sgeller opened 2 years ago

sgeller commented 2 years ago

As we upgraded the asset-pipeline from v3.3.6 to v3.4.0 we've encountered the following stack trace:

java.util.LinkedHashMap.toFlatConfig() is applicable for argument types: () values: []
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70)
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
        at asset.pipeline.AssetPipelineGrailsPlugin$_doWithSpring_closure2.doCall(AssetPipelineGrailsPlugin.groovy:106)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)

circling back to this https://github.com/bertramdev/asset-pipeline/commit/79160729f88484d5fe6bab3c1df5008b35fa4e38#diff-5196ae3e10df42808b5a9addbe0a5fa15f8e72515238bd69057a32d43ac7a364R106 change.

Config used (same for both versions):

assets {
    minifyJs = true
    minifyCss = true
    enableSourceMaps = true

    // exclude dependent less files from being individually compiled
    excludes = ['less/**/*.less']

    minifyOptions = [ optimizationLevel: 'WHITESPACE_ONLY' ]

    // disable processing js directives require()
    configOptions = [commonJs: false]
}

Pinging @ltamaster as the author of the change. Please let me know if you need more information.

davydotcom commented 2 years ago

which version of grails did you use this on

sgeller commented 2 years ago

grailsVersion=4.0.10

davydotcom commented 2 years ago

this is probably why as this was upgraded for grails5. ill see if i can have it handle either.

sgeller commented 2 years ago

Thanks!

matthijsbierman commented 2 years ago

Was seeing the same exception on a new project with Grails 5.1.4 and asset pipeline 3.4.0. Fixed with 3.4.1.