Skip to content

Better error checking and messages for beginners #1518

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

Closed
jacwright opened this issue May 31, 2018 · 0 comments
Closed

Better error checking and messages for beginners #1518

jacwright opened this issue May 31, 2018 · 0 comments

Comments

@jacwright
Copy link
Contributor

We should have better error checking and error messages in dev mode to make it easier to learn and develop in Svelte. IMO this is a must to increase widespread adoption since people trying it out will be frustrated and drop it if they don't understand what is going on within the template.

It's very cool to see what code the template is generating, but it should be a goal that you don't need to understand what is being generated to be successful using Svelte.

For example, when you have {#each items as item} in your template and items is undefined you get the error Cannot read property 'length' of undefined. It would be nicer if the error was `items` is undefined in {#each items as item}. It might even be nicer if we output the lines before and after this from the template into the console all fancy like. Perhaps an Error Framework to make it super easy to understand issues in your app.

Other places for additional error checking:

  • undefined/nulls in bind, e.g. { person.name } when person is null

What other errors within templates we add better error checking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants