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

Astro unexpectedly stringifies undefined class attribute #11413

Closed
1 task done
delucis opened this issue Jul 4, 2024 · 1 comment
Closed
1 task done

Astro unexpectedly stringifies undefined class attribute #11413

delucis opened this issue Jul 4, 2024 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@delucis
Copy link
Member

delucis commented Jul 4, 2024

Astro Info

Astro                    v4.11.5
Node                     v18.20.3
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

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

n/a

Describe the Bug

When using the When using the 'where' or 'class' scopedStyleStrategy, an undefined class attribute passed down to a child component is incorrectly stringified.

For example, <ChildComponent class={undefined} /> can receive undefined astro-XXXX as the value of Astro.props.class. (Assuming the parent component is also using scoped styles and therefore has an associated hash ID.)

What's the expected result?

<ChildComponent class={undefined} /> should receive only astro-XXXX as the value of Astro.props.class, without undefined appearing in the class string.


Notes

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-i2qay8?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@delucis
Copy link
Member Author

delucis commented Jul 4, 2024

I knew this seemed familiar — I already reported this once in the past withastro/compiler#1005 😅

Guess I’ll close this in favour of that one then.

@delucis delucis closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
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
Development

No branches or pull requests

1 participant