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

Enhance MDX Preview by Resolving TypeScript Build Errors in .astro Files #130

Open
myisaak opened this issue Aug 8, 2024 · 0 comments
Open

Comments

@myisaak
Copy link

myisaak commented Aug 8, 2024

The MDX preview currently fails to compile .astro files that use TypeScript, especially with import type statements, causing build-time errors that block development. This issue limits the integration of TypeScript with Astro, reducing developer productivity and the overall appeal of using Astro for TypeScript-heavy projects. A potential fix involves using the TypeScript runtime instead of NodeJS to handle .astro files, but guidance from a maintainer is needed to ensure proper integration. I'm available to collaborate on this fix and contribute independently to improve the Astro ecosystem.

This happened after I opened your editor on an MDX file that used Astro:

Failed to compile

unknown: Unexpected token, expected "(" (2:7)

  1 | ---
> 2 | import type { HTMLAttributes } from 'astro/types';
    |        ^
  3 | 
  4 | type Props = HTMLAttributes<'a'>;
  5 | 
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

No branches or pull requests

1 participant