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

Svelte island does not expect unknown props, causes warning #9508

Closed
1 task done
nikhilk opened this issue Dec 24, 2023 · 1 comment · Fixed by #9510
Closed
1 task done

Svelte island does not expect unknown props, causes warning #9508

nikhilk opened this issue Dec 24, 2023 · 1 comment · Fixed by #9510
Labels
needs triage Issue needs to be triaged

Comments

@nikhilk
Copy link
Contributor

nikhilk commented Dec 24, 2023

Astro Info

Astro                    v4.0.7
Node                     v20.10.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/svelte
                         @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I have a very simple counter svelte component included into an Astro component.

When viewing the page after running "astro dev", I see the following warning in the console.

<Counter> was created with unknown prop 'data-astro-cid-j7pv25f6'

I see this is a warning generated from the stackblitz sample for Svelte as well (linked as reproducible example)

What's the expected result?

Ideally this warning should not appear, as it adds noise to the console. With a warning per component, this can easily make the experience poor.

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-svelte?file=src%2Fcomponents%2FCounter.svelte

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 24, 2023
nikhilk added a commit to nikhilk/astro that referenced this issue Dec 24, 2023
Fixes withastro#9508

The existing console filter looked for class attributes. This change adds a check for warnings related to data attributes as well.
nikhilk added a commit to nikhilk/astro that referenced this issue Dec 24, 2023
@Indyandie
Copy link

😌 Phew… I'm glad I found this! I thought it had something to do with one of my dependencies.

Card.svelte:82 <Card> was created with unknown prop 'data-astro-cid-bqi7seht'

I'm in the of upgrading to astro 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
2 participants