Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug: CalHeatmap Not Rendering in Svelte Project #522

Open
Michael-Obele opened this issue Sep 10, 2024 · 0 comments
Open

🐛 Bug: CalHeatmap Not Rendering in Svelte Project #522

Michael-Obele opened this issue Sep 10, 2024 · 0 comments

Comments

@Michael-Obele
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant