Compilation error TS1122 in apexcharts.d.ts
See original GitHub issueIssue
I can’t import apexcharts on my angular 5.2 project
Explanation
After doing
npm install apexcharts --save
When i tried to import the module
import {ApexCharts} from 'apexcharts'
I’ve got an error :
TS2305: Module ‘“apexcharts”’ has no exported member ‘ApexCharts’.
So i tried to import all the module
import * as ApexCharts from 'apexcharts'
But now, i’ve another error because the apexcharts.d.ts
contains an error, it is not compiling.
ERROR in node_modules/apexcharts/apexcharts.d.ts(526,16): error TS1122: A tuple type element list cannot be empty.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (2 by maintainers)
Top Results From Across the Web
reactjs - Module not found: Can't resolve 'apexcharts/dist ...
Failed to compile ./node_modules/react-apexcharts/dist/react-apexcharts.min.js Module not found: Can't resolve ...
Read more >Angular Pie Chart Basic Example - ApexCharts.js
Team D. Team E. 24.9% 31.1% 7.3% 24.3% 12.4% ... main.ts. polyfills.ts. styles.css. typings.d.ts .angular-cli.json. package.json ... @angular/compiler8.2.14.
Read more >How to create Angular charts using ApexCharts
Create Angular Charts using an ng-apexcharts component. Build beautiful and interactive visualizations in your Angular applications.
Read more >Series [Working with Data] - ApexCharts.js
Know which formats are supported by ApexCharts to parse your data correctly whether it be timeline or categorized data for building interactive charts....
Read more >A Vue Chart wrapper for ApexCharts.js
Create Vue Charts using Vue-ApexCharts. Build interactive visualizations in your vue 2.0 and vue 3.0 apps. Works in both Vue 2 and Vue...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sugihartolim ApexCharts is also exported as
commonjs
in the dist directory.Can you please try
Thank you @ivelfan & @junedchhipa , that’s the final piece that finally made it work. As of angular 7 and apexcharts 3.2.2, to recap just in case anyone else needs it: (Note that ‘module: es2015’ WILL NOT work)
tsconfig.json:
"compilerOptions" : {
"module": "commonjs",
"target": "es5",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
}
// @ts-ignore
'import ApexCharts from ‘apexcharts’; ’This is a temporary workaround until the export situation got resolved, i guess.