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

Parsing error when using variable of #556

Closed
5 of 6 tasks
errorx666 opened this issue May 15, 2024 · 7 comments
Closed
5 of 6 tasks

Parsing error when using variable of #556

errorx666 opened this issue May 15, 2024 · 7 comments
Labels
blocked bug Something isn't working released

Comments

@errorx666
Copy link

errorx666 commented May 15, 2024

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I am reporting a confirmed bug (not seek debugging help)
  • I understand this is a collaborative project and relies on my contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://stackblitz.com/edit/stackblitz-starters-gtalwu?file=tsconfig.json

Problem & expected behavior (under 200 words)

npm start

Expected: code runs
Actual: Parse error

Works with bun

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work financially will speed up resolution

  • I'm willing to offer financial support
@errorx666 errorx666 added bug Something isn't working pending triage labels May 15, 2024
@errorx666
Copy link
Author

I started with a real-world error and stripped out as much as possible while still preserving the error.

@privatenumber
Copy link
Owner

I appreciate the effort but the reproduction is not minimal at all... There's 7 files and 11 dependencies. Please minimize it so tsx is the only dependency.

@privatenumber privatenumber closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
@errorx666
Copy link
Author

errorx666 commented May 15, 2024

@privatenumber I have reduced it to one file and one external dependency. Please check again.

@privatenumber privatenumber reopened this May 16, 2024
@privatenumber
Copy link
Owner

Thanks, I appreciate it!

I believe the root problem is in es-module-lexer assuming of is a reserved identifier. I reported it here: guybedford/es-module-lexer#173

I also noticed an opportunity to skip the parsing completely in your case as the parsing is only used to detect dynamic imports, which you're not using. Upgrading to tsx v4.10.3 should fix your use-case.

@privatenumber privatenumber changed the title Parse error running tsx Parsing error when using variable of May 16, 2024
@errorx666
Copy link
Author

Thank you for the quick turnaround! I would never have thought of that.

@privatenumber
Copy link
Owner

Fixed in guybedford/es-module-lexer#173

@privatenumber
Copy link
Owner

🎉 This issue has been resolved in v4.10.5

If you appreciate this project, please consider supporting this project by sponsoring ❤️ 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants