Closed lasseeee closed 4 years ago
How do you load c3.js? Do you use webpack?
Yes. It's loaded using Webpack (Laravel Mix) with window.c3 = require('c3');
I have the same issue after the latest release. I'm using webpack 4.41.5 and latest changes in c3 exports broke the dynamic imports for me. The workaround is to use c3.default.generate
or revert to older version of the c3.
In 0.7.11 this works fine:
import('c3')
.then(c3 => c3.generate({...}))
In 0.7.12 I need to use:
import('c3')
.then(c3 => c3.default.generate({...}))
https://github.com/c3js/c3/pull/2740 seems to have affected webpack build. Webpack uses module
field instead of main
if module
is present in package.json.
I just upgraded from
C3 version: 0.7.11 D3 version: 5.15.0
to
C3 version: 0.7.12 D3 version: 5.15.0
And all charts that were working are now broken with the error:
TypeError: c3.generate is not a function
I'm loading the charts like this at the end of the file: