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

🐛 BUG: Client side <script/> tags in Astro components break when using named imports. #3576

Closed
1 task done
shaunchander opened this issue Jun 11, 2022 · 2 comments · Fixed by #3625
Closed
1 task done
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@shaunchander
Copy link

shaunchander commented Jun 11, 2022

What version of astro are you using?

1.0.0-beta.44

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

MacOS

Describe the Bug

🐛 Client-side <script /> tags present in Astro components are not bundled when importing said component using named imports, ie:

import { ComponentName } from "@components/ComponentName"

The expected behavior is that any, non-inlined <script /> tag in a named Astro component should be bundled just as it is normally when using a default exported Astro component.

⚠️ This bug does not affect inlined-scripts, they work as expected whether you are using a default exported Astro component or a named one.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-cbpkqr?file=src/pages/index.astro

Participation

  • I am willing to submit a pull request for this issue.
@natemoo-re natemoo-re added - P4: important Violate documented behavior or significantly impacts performance (priority) s2-medium labels Jun 13, 2022
@natemoo-re
Copy link
Member

I would love for @matthewp or @bholmesdev to weigh in on this, I think we're aware that there are problem here but maybe not aware of this particular one.

@matthewp
Copy link
Contributor

I think this will likely be fixed when we fix #3217. It's the same core issue, that our discovering of what to build in the client can't pass through non-astro files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants