-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Unable to resolve a valid export with dynamic component #8746
Comments
Noticed this with react as well. Using a component by any name other than its imported one breaks. Replacing index.astro with this on https://astro.new/framework-react?on=stackblitz seems to be enough. ---
import Counter from '../components/Counter.tsx';
const Component = Counter
---
<Component count={0} client:load> |
Yeah this is a limitation of Astro's static analysis. In order to bundle islands, we need to know which file they come from. As soon the connection between a Component and its import statement is broken, we can no longer trace which files need to be bundled. We could definitely improve this error message, though. |
Yes! I think the solution is to move this dynamic component selection to a UI framework? If yes, then it could be stated in the error message |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I have this code in an astro page:
But this throws this error, both when running
astro dev
andastro build
:To be precise, it throws the error, then the server refreshes multiple times, then it renders eveything but the failing part
What's the expected result?
It should pick the right component and render it
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-ddmc8h?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: