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

Type generation incompatible with Astro #6965

Open
ivyrze opened this issue Jun 18, 2024 · 0 comments
Open

Type generation incompatible with Astro #6965

ivyrze opened this issue Jun 18, 2024 · 0 comments
Labels
Feature typegen Issues related to TypeScript types generation

Comments

@ivyrze
Copy link

ivyrze commented Jun 18, 2024

Describe the bug

I'm trying to use GROQ typegen in my Astro project, but it doesn't recognize the JSX-in-frontmatter syntax and mistakenly thinks its all errors, for example:

src/pages/about.astro: `import` can only be used in `import()` or `import.meta`. (2:0)

  1 | ---
> 2 | import Layout from '../layouts/BlogPost.astro';

Using the same code in a standard JSX format produces expected results.

To Reproduce

Steps to reproduce the behavior:

  1. Follow Astro + Sanity getting started guide.
  2. Create sanity-typegen.json to include .astro files in the path search glob.
  3. Run sanity schema extract && sanity typegen generate.

Expected behavior

The types should generate without error.

Which versions of Sanity are you using?

Run sanity versions in the terminal and copy-paste the result here.

@sanity/cli (global)  3.46.1 (up to date)
@sanity/astro          3.1.3 (up to date)
@sanity/image-url      1.0.2 (up to date)
@sanity/types         3.46.1 (up to date)
@sanity/vision        3.46.1 (up to date)
sanity                3.46.1 (up to date)

What operating system are you using?

macOS 14.5

Which versions of Node.js / npm are you running?

Run npm -v && node -v in the terminal and copy-paste the result here.

10.2.4
v18.19.1
@rexxars rexxars added the typegen Issues related to TypeScript types generation label Jun 18, 2024
@linear linear bot removed the typegen Issues related to TypeScript types generation label Jun 18, 2024
@sgulseth sgulseth added Feature typegen Issues related to TypeScript types generation labels Jun 24, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature typegen Issues related to TypeScript types generation
Projects
None yet
Development

No branches or pull requests

3 participants