Hello!
I am new to Astro. Trying to follow the doc example with AstroGreeter here https://docs.astro.build/en/guides/client-side-scripts/#pass-frontmatter-variables-to-scripts
If I put 1 AstroGreeter it works, but if I put more multiples once, I get a js error "redeclaration of let AstroGreet" and the buttons are not working. Any idea how to avoid this?
#Pass frontmatter variables to scripts - problem with the example of the doc
15 messages · Page 1 of 1 (latest)
What does your code look like? I just recreated it real quick and its working just fine.
thanks for having a look. It really looks the same, let me try to find the diff
Sorry, it's my first time with stackblitz, is there a way to see the result without login in?
I really don't find any difference, I also just copy pasted the example of the doc
Oh, I think I see what the root of the problem is
I forked this project
GitLab
Example Astro site using GitLab Pages: https://pages.gitlab.io/astro
which was not updated since 2+ years
so the version of Astro was super old
ok, after upgrading and getting rid of the old stuff (Markdown import), it now works
I guess an option would be to update the gitlab example 🙂
Interesting. Ill take a look and see
Forked the repo and updated it. Putting in the PR now. https://gitlab.com/hkbertoson/astro
GitLab
Example Astro site using GitLab Pages: https://pages.gitlab.io/astro