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

ssrTransform can cause syntax error #19096

Closed
7 tasks done
TheAlexLichter opened this issue Dec 29, 2024 · 0 comments · Fixed by #19097
Closed
7 tasks done

ssrTransform can cause syntax error #19096

TheAlexLichter opened this issue Dec 29, 2024 · 0 comments · Fixed by #19097
Labels
feat: ssr p4-important Violate documented behavior or significantly improves performance (priority)

Comments

@TheAlexLichter
Copy link
Contributor

TheAlexLichter commented Dec 29, 2024

Describe the bug

When transforming https://unpkg.com/browse/@headlessui/[email protected]/dist/components/transitions/transition.js in an application (see e.g. nuxt/ui#2971), it will lead to invalid javascript code due an extraneous (and syntactically wrong ;). This is based on #18748 (comment)

Seems like there is a collision when the code is minified, a ; is inserted and the (0, ...) is happening afterwards.

Reproduction

https://github.com/TheAlexLichter/vite/tree/fix/syntax-error-ssr

Steps to reproduce

I've created a failing test (for an upcoming PR) that highlights the broken behavior.

System Info

not relevant

Used Package Manager

pnpm

Logs

No response

Validations

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

Successfully merging a pull request may close this issue.

2 participants