У меня очень простой проект веб-пакета с использованием плагина Html для создания файла html из одной записи js.
Я установил c3 с "npm install c3"
диаграмма. js
import * as c3 from "c3";
var chart = c3.generate({
bindto: '#chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});
при загрузке страницы появляется ошибка:
bootstrap:893 TypeError: c3.generate is not a function
at chart.js:5
at chart.js:14
__webpack_require__.oe @ bootstrap:893
Promise.catch (async)
./client/chart.js @ chart.js:14
__webpack_require__ @ bootstrap:769
fn @ bootstrap:129
6 @ module.js:22
__webpack_require__ @ bootstrap:769
(anonymous) @ bootstrap:907
(anonymous) @ bootstrap:907
chart.js:5 Uncaught (in promise) TypeError: c3.generate is not a function
at chart.js:5
at chart.js:14
(anonymous) @ chart.js:5
(anonymous) @ chart.js:14
Promise.catch (async)
./client/chart.js @ chart.js:14
__webpack_require__ @ bootstrap:769
fn @ bootstrap:129
6 @ module.js:22
__webpack_require__ @ bootstrap:769
(anonymous) @ bootstrap:907
(anonymous) @ bootstrap:907
мой пакет. json содержит
"dependencies": {
"@types/c3": "^0.7.4",
"c3": "^0.7.12",
Любой совет очень ценится. c3 js .org не дает инструкции, как npm установить и использовать с импортом ES6.
спасибо