hperrin / svelte-material-ui

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

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

Closed JL102 closed 1 year ago

JL102 commented 1 year 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 1 year ago

Thank you!