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

Convert SunCalc to ESModule export #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SamLeatherdale
Copy link

@SamLeatherdale SamLeatherdale commented Apr 1, 2024

Pull Request Template for Home Assistant / Lovelace Card Repository

Overview

I am using this project as a submodule of my own HomeAssistant dashboard (HomeBoard)

There is an issue with importing SunCalc with Vite, where because it's a CommonJS export within an IIFE, it doesn't get picked up and I get the following error:

Uncaught SyntaxError: The requested module '/lovelace-horizon-card/suncalc3/suncalc.js' does not provide an export named 'default'

I have updated this module to use ES module syntax, and that resolves the issue.

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Documentation update
  • Refactoring
  • Other (please describe):

Checklist

Please ensure that you have completed the following tasks before submitting your pull request:

  • I have read the contributing guidelines for this project.
  • I have tested my changes against the dev branch (or another appropriate branch) and verified that they are working as expected.
  • I have updated the documentation (if applicable) to reflect my changes.
  • My changes adhere to the repository's code style guidelines.
  • My changes do not introduce any breaking changes or unexpected behaviors.

Related Issues / Pull Requests

Additional Details

Please provide any additional information that you feel is relevant to this pull request, such as screenshots, code snippets, or examples.

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

Successfully merging this pull request may close these issues.

1 participant