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

Fix tsup CJS transpile errors #24

Merged
merged 1 commit into from
Dec 23, 2024
Merged

Fix tsup CJS transpile errors #24

merged 1 commit into from
Dec 23, 2024

Conversation

gregnr
Copy link
Contributor

@gregnr gregnr commented Dec 23, 2024

tsup has a bug that produces invalid CJS code under very specific conditions. Unfortunately we fall under these conditions and our CJS output contains the same error:

SyntaxError: Unexpected token ','

One of these conditions is instantiating a class property outside of the constructor. This PR moves these instantiations to inside the constructor, which is logically equivalent but just less ergonomic. The CJS output is confirmed to be fixed after this change. We can move these back after the above tsup issue is resolved.

Fixes #23

@gregnr gregnr merged commit c7ccafb into next Dec 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants