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

slots appear to be broken in components rendered within a .map method #959

Closed
1 task done
ZeldOcarina opened this issue Feb 3, 2024 · 9 comments · Fixed by #963
Closed
1 task done

slots appear to be broken in components rendered within a .map method #959

ZeldOcarina opened this issue Feb 3, 2024 · 9 comments · Fixed by #963
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@ZeldOcarina
Copy link

Astro Info

Astro                    v4.3.2
Node                     v18.18.0
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             none

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

No response

Describe the Bug

After upgrading to 4.3.2 slots appear to be broken if components are rendered within a map.

This is super weird as this approach I am using has been always working.

See Discord support ticket too.

What's the expected result?

We should get both "Hero" and "Component2" on the screen. Nothing before the last item in the switch statement is rendered, even statically added Astro elements.

Link to Minimal Reproducible Example

https://stackblitz.com/~/edit/github-c7fcrc

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 Feb 3, 2024
@sanghanihimanshu
Copy link

why router refreshing page ?

@ZeldOcarina
Copy link
Author

I am sorry I don't think I quite understand your comment.

@erfianugrah
Copy link

Did reverting the compiler to 2.5.1 fix it? I've had that issue because I did an npm update 4.2.6 onwards, I'm on 4.3.2 and </slot> works

@BryceRussell
Copy link
Member

Confirmed this is a compiler bug, I made a reproduction here: https://stackblitz.com/edit/github-c7fcrc-tftu1q?file=src%2Fpages%2Findex.astro

Reverting back to 2.5.1 fixes the issue

@ZeldOcarina
Copy link
Author

Downgrading fixes the issue on the repro environment, it's probably some issue with the last release where #950 was closed. It should be reopened imo

@ZeldOcarina
Copy link
Author

@MoustaphaDev I think something went south on this PR: withastro/astro#9605.
Can you please take a look? 😇

@MoustaphaDev
Copy link
Member

Thanks for reporting! This seems related to #955, we'll make sure to get this fixed as soon as possible.
Sorry for the inconvenience!

@MoustaphaDev MoustaphaDev transferred this issue from withastro/astro Feb 3, 2024
@MoustaphaDev MoustaphaDev added the - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) label Feb 3, 2024
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Feb 3, 2024
@ZeldOcarina
Copy link
Author

It happens thanks a lot!

MoustaphaDev added a commit that referenced this issue Feb 6, 2024
Princesseuh pushed a commit that referenced this issue Feb 6, 2024
…" (#963)

* test(#955): add failing test

* test(#955): add another failing test

* test: whoops it actually passes

* Revert "Fix slot regression when there are multiple expressions (#952)"

This reverts commit 418558c.

* Revert "Fix various issues with slots (#933)"

This reverts commit db13db9.

* chore: changeset

* chore: remove slot parens in test

* test: update test

* chore: remove slot parens in test

* test: add test for #959

---------

Co-authored-by: Nate Moore <[email protected]>
@ZeldOcarina
Copy link
Author

Thank you! How will I know when this is live in the next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants