You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to instantiate and render a CalHeatmap instance within a Svelte project, the heatmap fails to render. A TypeScript error related to the constructor of CalHeatmap is also encountered.
To Reproduce
Install cal-heatmap and its type definitions:
npm install cal-heatmap @types/cal-heatmap
Import and try to instantiate CalHeatmap in a Svelte component:
<script lang="ts">
import CalHeatmap from 'cal-heatmap';
const cal = new CalHeatmap();
cal.paint({});
</script>
<div id="cal-heatmap"></div>
Expected behavior
The CalHeatmap object should be instantiated without errors, and the heatmap should render within the specified HTML element (in this case, the div with the id "cal-heatmap").
Actual behavior
A TypeScript error occurs during compilation: "This expression is not constructable. Type 'typeof import(...)' has no construct signatures."
The heatmap does not render on the page.
Additional context
This issue appears to be specific to Svelte projects, as the same code might work in other JavaScript environments.
The root cause could be related to how Svelte handles component lifecycles or interacts with external libraries like cal-heatmap.
The text was updated successfully, but these errors were encountered:
When attempting to instantiate and render a CalHeatmap instance within a Svelte project, the heatmap fails to render. A TypeScript error related to the constructor of CalHeatmap is also encountered.
To Reproduce
Install cal-heatmap and its type definitions:
npm install cal-heatmap @types/cal-heatmap
Import and try to instantiate CalHeatmap in a Svelte component:
Expected behavior
The CalHeatmap object should be instantiated without errors, and the heatmap should render within the specified HTML element (in this case, the div with the id "cal-heatmap").
Actual behavior
Additional context
The text was updated successfully, but these errors were encountered: