hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.27k stars 287 forks source link

refactor: improved error messsage when Textfield is initialized incorrectly #637

Closed JL102 closed 7 months ago

JL102 commented 8 months ago

This PR originates from me spending about an hour debugging the inexplicable error Uncaught (in promise) Error: SMUI Textfield initialized without Input component. Turns out, I didn't initalize the value, i.e. I did this:

<Textfield bind:value />

<script lang="ts">
  import Textfield from '@smui/textfield';

  let value;
</script>

With this change, the error message more clearly points people to the cause of the issue.

hperrin commented 7 months ago

Thank you!