Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [astrojs]

A website building framework giving high speed performance and a modernized development flow. Astro supports both a SSG (static-site-generation) and SSR (server-side-rendering) mode. Either way, the output is a website with zero JavaScript sent to the browser, which results in maximized speed for loading content. React/Solid/Svelte/Vue islands can be loaded as well for client-side interactivity.

astrojs
0 votes
0 answers
3 views

Keep getting error `[vite]: Rollup failed to resolve import "tslib" from "/vercel/path0/node_modules/.pnpm/[email protected]` upon deployments to vercel

I am building an AstroJS project with Sanity as CMS - on my development environment everything works fine and the build is also successful But when I try to deploy the project to vercel, I keep ...
NaineeL SoyantaR's user avatar
0 votes
0 answers
11 views

How to use a react context in astro island without re-rendering the provider

So I have two pages that want to share the same react context (QueryClientProvider in this case). The problem is that the only way I was able to achieve this leads to re-rendering of the context ...
pycan's user avatar
  • 351
0 votes
0 answers
33 views

How do I put an image on top of another using TailwindCSS?

I'm trying to put one image on top of another on my InfoComponent, and I want it to look something like this: However, I just can't seem to do it. I need to make it responsive. I have no idea how to ...
Mike the Scripter's user avatar
0 votes
0 answers
22 views

Astro page-load event is triggered in other page

I am a Astro begginer. I am using ViewTransitions. I am writting a website with several pages. In index.astro, I have a script which modifies some <a> elements. Therefore, I have written this in ...
Jaime02's user avatar
  • 193
0 votes
0 answers
26 views

Astro public subfolders not resolving

I setup a default Astro project, and wanted to make subfolders within /public however they are not available locally. As example: /public/foobar.jpg resolves as <img src=/foobar.jpg/> /public/...
Jesper Lind's user avatar
-1 votes
0 answers
18 views

How do I change the Favicon in Astro.js? [duplicate]

I'm trying to figure out how to change the favicon in Astro, but I can't figure it out. I tried changing it by adding my own custom image and labeling it "favicon.svg" but it doesn't work. ...
Mike the Scripter's user avatar
0 votes
0 answers
22 views

ASTRO / SendGrid - Redirecting when sending is successful or gives error

I have an issue with Astro.redirect. It constantly gives me an error: "AstroError [ResponseSentError]: The response has already been sent to the browser and cannot be altered" I just want to ...
Carlos's user avatar
  • 1
1 vote
1 answer
17 views

Fixing a local markdown image reference in AstroJS?

I have this folder structure in my astroJS project, where I seperate each blog content by an YYYYMMDD name prefix pages blogs 20220505 index.md img/pikachu.png 20230401 ...
Vincent Tang's user avatar
  • 4,030
0 votes
0 answers
31 views

Unable to use Astro Image Component with Astro DB that store the Links to them

So, i am trying to use AstroJs's Image Component to Display Optimized images on the Page. i have put my images in the Project / src / images directory. the only way to Provide a Link to the image is ...
Keshav's user avatar
  • 33
0 votes
1 answer
24 views

How to evaluate a expression inside a <script> element in JSX using Astro?

I've the following code in an Astro component: BaseHead.astro <!-- Schema.org --> <script type="application/ld+json"> { "@context": "http://schema.org", ...
Lucas David Ferrero's user avatar
0 votes
0 answers
23 views

How to style slotted child elements in Astro Layout?

I'm building out my company's blog post page and am having some trouble styling slotted content that comes from my markdown blog posts. Specifically, I want add some top padding to all child elements ...
buildpax's user avatar
  • 340
0 votes
1 answer
26 views

Astro.currentLocale in Framework Components for SSR

I've built an app localized by Astro's i18n routing. To get the current locale, on server-side I use Astro.currentLocale and on client-side I use window.location.pathname with a helper function that ...
abegehr's user avatar
  • 539
0 votes
1 answer
44 views

Import .md files dynamically by slug

i am pretty new to Astro, and i want to find out how to have a file such as [...slug] read md files based on that slug. Best with using collection entries or something similar. It seems there is no ...
smoothcode onyx's user avatar
0 votes
1 answer
18 views

How to create use and html element prop to determine the element used by and Astro component

I want to create an Astro component that can be any html element the user passes to it in props. I'm not even sure it is possible with Astro components. Something like this, but with the right syntax. ...
Clayton Ingalls's user avatar
0 votes
0 answers
21 views

container query does not work in inline or from external css file in Astro [duplicate]

having below css file and imported in Astro but container query does not seem to work; also tries the :is-inline directive within .Astro file but it doesnt getting applied panel.css main { container-...
xkeshav's user avatar
  • 53.5k

15 30 50 per page
1
2 3 4 5
46