pepstock-org / Charba

J2CL and GWT Charts library based on CHART.JS
https://pepstock-org.github.io/Charba-Wiki/docs
Apache License 2.0
62 stars 6 forks source link

Exception: Unable to override 'datetimeAdapter' with a custom implementation #58

Closed MartinSchwarzbauer closed 3 years ago

MartinSchwarzbauer commented 3 years ago

Hi!

I am using latest charba version 4.0 for gwt (master)! In development mode charts are working perfectly! Then i compile the GWT source without any error and warnings => but when webpage is loaded in browser i always get the following error: Unable to override 'datetimeAdapter' with a custom implementation

webserver-0.js:60520 Uncaught Error: Class$S47: Unable to override 'datetimeAdapter' with a custom implementation
    at IllegalArgumentException_0._.createError (webserver-0.js:60520)
    at IllegalArgumentException_0._.initializeBackingError (webserver-0.js:60531)
    at IllegalArgumentException_0.Exception_0 (webserver-0.js:60551)
    at IllegalArgumentException_0.RuntimeException_0 (webserver-0.js:60561)
    at new IllegalArgumentException_0 (webserver-0.js:89099)
    at LuxonAdapterResource.AbstractInjectableResource (webserver-0.js:97405)
    at LuxonAdapterResource.AbstractInjectableResource_0 (webserver-0.js:97414)
    at new LuxonAdapterResource (webserver-0.js:109756)
    at new EmbeddedResources (webserver-0.js:109736)
    at $clinit_EmbeddedResources (webserver-0.js:109708)
    at enable_0 (webserver-0.js:94470)
    at Array.init (webserver-0.js:69737)
    at initializeModules (webserver-0.js:1906)
    at apply_0 (webserver-0.js:60738)
    at entry0 (webserver-0.js:60771)
    at webserver-0.js:60761
    at gwtOnLoad_0 (webserver-0.js:1919)
    at webserver-0.js:109870

I tried 'Charba.enable' and 'DeferredCharba.enable(...)' and both give me the same error!

stockiNail commented 3 years ago

@MartinSchwarzbauer Can you provide the code when you are invoking Charba.enable or DeferredCharba.enable?

MartinSchwarzbauer commented 3 years ago

I think i've found the difference from showcase source to my source:

I compiled my GWT source with the following option: '-XdisableClassMetadata'

When i remove this option. the charts are working!

stockiNail commented 3 years ago

@MartinSchwarzbauer FINE!!!! Very good!

Be aware that we have finished version 4.0 and we are waiting for the Datalabels plugin in order to release it. Really thank you for testing and using it!

MartinSchwarzbauer commented 3 years ago

I started using Charba yesterday ... and because of upcoming changes in the API i decided to test and use latest version :)!

stockiNail commented 3 years ago

I started using Charba yesterday ... and because of upcoming changes in the API i decided to test and use latest version :)!

Thank you!

I committed today some updates... Some class names are changed (but maybe you are not using them). I hope it could not be a issue for your development.

stockiNail commented 3 years ago

'-XdisableClassMetadata'

This options disables some java.lang.Class methods (e.g. getName()).

Charba uses getName and other methods of Class.

Thanks @MartinSchwarzbauer

stockiNail commented 3 years ago

@MartinSchwarzbauer FYI we changed some internals of Charba in order to use it even if you are using -XdisableClassMetadata GWT compiler option. The implementation has been merged in the current master branch and will be be available in next version, 4.2.

Thanks a lot!