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

ComponentParser: Cannot read properties of null (reading 'type') #104

Open
techniq opened this issue Nov 30, 2022 · 0 comments
Open

ComponentParser: Cannot read properties of null (reading 'type') #104

techniq opened this issue Nov 30, 2022 · 0 comments

Comments

@techniq
Copy link

techniq commented Nov 30, 2022

If you re-export an imported component in context="module", it currently throws this error: Cannot read properties of null (reading 'type').

I do this in the Chart component of LayerChart to simplify accessing layercake's Svg and Html components (which LayerChart is built upon).

<script context="module" lang="ts">
  import { LayerCake, Svg, Html } from 'layercake';
  export { Svg, Html };
</script>

This can be tested on https://sveld.onrender.com/ with this snippet.

as a workaround, I found you can redeclare them:

<script context="module" lang="ts">
  import { LayerCake, Svg as _Svg, Html as _Html } from 'layercake';

  export const Svg = _Svg;
  export const Html = _Html;
</script>

Note: this used to work, but I recently worked on upgrading all my dependencies, and upgrading vite-plugin-sveld from 1.0.3 to 1.1.0, which bumped sveld from 0.8.3 to 0.18.0 (based on package-lock.json), is when the problem started.

Thanks for the awesome project btw.

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