-
-
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
🐛 No good error message when adding a client directive to an Astro component #4090
Comments
I think this Regex is the issue:
Negative-lookbehind regexes are not supported in Safari. @matthewp What is the reason for the lookbehind? I don't notice any difference when I remove it. |
That code doesn't run in the browser. |
Oh. You have |
I think having the warning message is great, and it seems to work in
I'm reopening this because it's a very recent fix and still on topic IMHO. If you think the potential improvements should be handled in a new bug, please let me know and I'll create a new one! :) |
What version of
astro
are you using?1.0.0-rc.2
Are you using an SSR adapter? If so, which one?
No
What package manager are you using?
pnpm
What operating system are you using?
Mac
Describe the Bug
When you have a Preact component and a regular Astro component in the same project, and both have
client:idle
(or any other version of this), it will run into a syntax error on Safari. The location of the components does not matter. They can be in different pages, or on the same page. This bug seems to only happen after a production build, and only on Safari. Both desktop and mobile versions. It blocks all JavaScript from running.Adding a
<script>
tag, a frontmatter, etc, does not resolve the issue. The reproduction is the most simple example I could create. Adding more code will still result in the error.I have not tried using other integrations. I have only tested it with Preact.
Reproduction steps
http://localhost:3000
There should be an error in the terminal
It seems to point to this part of the code
It specifically points to this part
await a()
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-bzqxfw?file=src%2Fcomponents%2FPreactComponent.tsx,src%2Fpages%2Findex.astro&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: