Sorixelle / astro-ts-mode

Emacs major mode for Astro templates
GNU General Public License v3.0
13 stars 1 forks source link

Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 2 " #9

Open FilConscious opened 4 months ago

FilConscious commented 4 months ago

Hi Sorixelle,

Thanks a lot for the package. I have followed your installation instructions without any errors, specifically:

When I open a .astro file the major mode is not detected (it remains Fundamental in the mode line) but it is activated if I do M-x astro-ts-mode (I see the change in the mode line). However, no code is highlighted and tree-sitter throws the error below:

Screenshot from 2024-03-05 09-37-13

Any help would be really appreciated.

Sorixelle commented 4 months ago

Are you able to provide an .astro file that reproduces this issue?

zetashift commented 1 month ago

I'm running into this as well, I believe the tree-sitter-astro changed in a way that the queries don't work. This errors pops up for me from the most basic of astro files :

---
interface Props {
  title: string;
}

const { title } = Astro.props;
---

<!doctype html>
<html lang="en" data-theme="pastel">
  <head>
    <meta charset="UTF-8" />
    <meta name="description" content="Astro description" />
    <meta name="viewport" content="width=device-width" />
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
    <link rel="manifest" href="/site.webmanifest" />
    <meta name="generator" content={Astro.generator} />
    <title>{title}</title>
  </head>
  <body class="scroll-smooth">
    <slot />
  </body>
</html>
g7s commented 1 month ago

Same here, even with the placeholder index.astro

---
// Welcome to Astro! Everything between these triple-dash code fences
// is your "component frontmatter". It never runs in the browser.
console.log('This runs in your terminal, not the browser!');
---

<!-- Below is your "component template." It's just HTML, but with
     some magic sprinkled in to help you build great templates. -->
<html>
  <body>
    <h1>Hello, World!</h1>
  </body>
</html>

<style>
  h1 {
    color: orange;
  }
</style>

Does anyone have any workarounds?