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

Info: Warnings in developer console #11

Closed
manuel3108 opened this issue May 10, 2020 · 4 comments
Closed

Info: Warnings in developer console #11

manuel3108 opened this issue May 10, 2020 · 4 comments

Comments

@manuel3108
Copy link

On every page change i got a warning the dev-console that

A component was created without the Attribute params

By using

{#if params === undefined}
	<svelte:component this={Route}/>
{:else}
	<svelte:component this={Route} {params} />
{/if}

instead of

<svelte:component this={Route} {params} />

in App.svelte, and setting params = undefined every time your page dost not have any params, you can get rid of this warning.

This should just be an info to those who are also annoyed, so feel free to close :D

@lukeed
Copy link
Owner

lukeed commented May 10, 2020

Hey, thanks :)

Warnings from the svelte compiler aren't issues or problems, necessarily -- it's just how we can notify the developer of potential issues.

In this case it's the desired behavior and there's no drawback to it, so I'd rather have simpler component code than potentially convey that you have to do it a more verbose way.

Will close, but thanks for double-checking :)

@lukeed lukeed closed this as completed May 10, 2020
@frederikhors
Copy link

It's very annoying to have warnings on each navigated page.

Can we use stores for params?

@lukeed
Copy link
Owner

lukeed commented May 11, 2020

No, not here. In your app you can, or use the workaround mentioned above.

Keep in mind this is a demo to jumpstart/illustrate Svelte usage.

@manuel3108
Copy link
Author

I agree with you, even if i think that production ready applications should not have those warnings. Might indicate the developer has done weird stuff.

But as mentioned above, this should just be a notice for other developers also wanting to remove them

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

3 participants