Questions tagged [astro]

Astro is an all-in-one web framework for building fast, content-focused websites. More info can be found here: https://astro.build/

Astro is an all-in-one web framework for building fast, content-focused websites.
More info can be found here: https://astro.build/

252 questions
6
votes
3 answers

Why Vercel Web vitals is not loading for my Astro Project?

I created a landing page using Astro with Tailwind CSS. And it is currently hosted on Vercel. I wanted to try out the analytics service provided by Vercel. I have been able to avail the Audience analytics service provided by Vercel. However, I…
paradus-hex
  • 221
  • 2
  • 6
5
votes
2 answers

How to share state among components in Astro?

I believe I'm taking the wrong approach in my code, how can I set a client side preference in a button click that is used as a prop in all my astro components globally? Or how should I do this? I know it is possible since astro js themselves do this…
Daniel Guedes
  • 387
  • 1
  • 4
  • 14
3
votes
4 answers

Import SVG file in Astro and use it without the tag

Is there a way to use and SVG file in an Astro file directly without using the tag. I want something like this: import Logo from "./logo.svg" and then use it like this: I tried that doing it like that but it didn't work.
Storm
  • 63
  • 1
  • 8
3
votes
1 answer

Multilanguage + Astro & LocalStorage

I want to create an astro component taking into account a variable in localstorage to get each component text, but Astro shows null. let locale = "en"; //default const userLanguage = localStorage.getItem("language"); if (userLanguage ) { locale =…
Chris_xD
  • 31
  • 2
3
votes
1 answer

OnClick event not working for React Component in Astro

I am using a react component for my astro project but the onclick event is not getting called. I am just trying to print link clicked when the link would be pressed, but I can't see any event being called. This is my react component - import {…
2
votes
1 answer

Tailwind-DaisyUI accordion and switch are not working

I have set up Astro project that has Tailwind and Daisy UI installed, but I am unable to get Daisy controls to work. I copy/pasted the code from the accordion page, but when the page is rendered, the controls do not work. It's like the controls are…
mack
  • 2,715
  • 8
  • 40
  • 68
2
votes
1 answer

Refreshing the page causes the page to be rendered blank and navigate() error is thrown

I have this simple hybrid SPA build with Astro, React, and RRDv6 Route tree: ˫ localhost/ ------------------(public page) ˫ localhost/login ------------(admin login page) ˪ localhost/admin/home ---(admin dashboard page) When I have successfully…
mitchiri_neko
  • 1,735
  • 2
  • 7
  • 12
2
votes
1 answer

Using markdown wiki-links in Astro framework

I'm building a website using the Astro framework, and I want to use Markdown wiki-links (links formatted like this [[link to post]] from Obsidian to link to other pages on my site. For example, I want to be able to write [[Page Name]] in my Markdown…
PHearst
  • 751
  • 6
  • 29
2
votes
0 answers

Getting "TypeError: fetch failed" when trying to use @vercel/og with Astro

I am trying to use the @vercel/og package to create an api route to generate open graph images. I have an Astro application and basically copied the framework agnostic vercel example: // api/og.ts import { ImageResponse } from "@vercel/og"; export…
Axel Padilla
  • 143
  • 7
2
votes
2 answers

when npm run dev diagnostics show up [Astro framework]

I'm studying astro framework. I tried some of template and it works great using this command npm run dev but I'm having problem with this official template. https://astro.build/themes/details/astro-paper/ I run npm create astro@latest -- --template…
bluetail
  • 183
  • 8
2
votes
1 answer

Bundle code as a separate js file in Astro (astro.build, astrojs)

I was wondering if there was way to have a src/somescript.ts to participate in bundling but to be output as a separate file in the build dist/somescript.ts not referenced by a page. When building a browser extension we can reference a…
stormwild
  • 2,855
  • 2
  • 31
  • 38
2
votes
2 answers

How to integrate Quasar UI into Astro SSG

I want to generate static site with Astro generator (https://astro.build/) and I want to use Quasar UI components (https://quasar.dev/) on the site. I found, I can set Vue app entry point in Astro config (astro.config.mjs): import {defineConfig}…
2
votes
2 answers

Can I pass additional classes to an Astro Component from parent?

I have an existing Astro component that already includes some classes in its template; however I'm trying to reuse this component on a different view and change the color of its header only on that view. So I read the docs saying that I can pass a…
IvanS95
  • 5,364
  • 4
  • 24
  • 62
2
votes
0 answers

Error "You forgot to wrap your component in " auth0

I have this problem with Auth0. The thing is that I am using Astro and integrated React to use a login and logout with Auth0. I will show you all the code I have and try to explain it to you to see if you can help me. this is a auth.jsx import React…
2
votes
1 answer
1
2 3
16 17