Questions tagged [astrojs]

A static site building framework giving high speed performance and a modernized development flow. Astro converts your website source code to static HTML during the building process, resulting in an almost fully static website with minimal JavaScript leftover. This results in maximized speed for loading content from the web browser.

196 questions
0
votes
1 answer

Tailwind not applying background image to tag

Related: Tailwind css backgroundImage doesn't work for me tailwind.config.js: module.exports = { theme: { ... extend: { ... backgroundImage: { "footer-sierpinski": "url('/bg.svg')", }, Layout.astro: ...
Sebi
  • 4,262
  • 13
  • 60
  • 116
0
votes
1 answer

Astro.js and React JS Error When Deploy in Netlify

When I try to deploy my first React component in Netlify with Astro.js it throws me this error in Netlify Deploy log: This are captures of my Astro page and React App component Does anybody knows hot to fix this?
React
  • 57
  • 7
0
votes
1 answer

How can I access the the Astro config values in a page?

I have an Astro project with an astro.config.mjs configured with a site value. export default defineConfig({ site: 'https://example.com', // ...etc }) In my layout, I have tags that have the same URL hard coded in them.
Soviut
  • 88,194
  • 49
  • 192
  • 260
0
votes
1 answer

How to use React and Solid-JS together?

We are migrating our web application from React to SolidJS. We want to make the change gradually by converting pages one at a time. I have been using astro to run both react and solidjs. The problem I encountered was navigating between react pages…
itaied
  • 119
  • 1
  • 1
  • 6
0
votes
1 answer

Tailwind flex-column working as row instead of column

I'm working on a simple portfolio webpage with Astro.js, Tailwind and Svelte, although the problem I have is with css only. This is the layout I want I thought that this might be one flex-row container with the second container being a flex-column…
RabidTunes
  • 775
  • 1
  • 8
  • 21
0
votes
1 answer

From a page in AstroJS [plugin:astro] location is not defined

In pages/index.astro if I try --- console.log(location.href) --- Then I get Error in text: [plugin:astro] location is not defined export statements in .astro files do not have access to local variable declarations, only imported values. How can…
Toni Michel Caubet
  • 19,333
  • 56
  • 202
  • 378
0
votes
1 answer

Astro.js dynamic import

so i have a bit of an issue, i am making a website, that changes content depending on API, right now the API request is only made during build, but i need for the site to dynamically update, so that when the price of the product is changed for…
Noel Dev
  • 38
  • 3
0
votes
1 answer

Simple astro plain javascript function

I am trying to learn Astro. I have this simple component and I don't know how to wire in a javascript function. Here is the code: const response = await fetch("http://localhost:5000/replacement_timeline", …
user2302244
  • 843
  • 2
  • 11
  • 27
0
votes
1 answer

Order by nested field using Astro

Given the following JSON response, how would I group them according to team first, then by year, using javascript and/or jsx to map the response? I'm using Astro. { "data": [ { "id": 1, "team_name": "Team One", "players": [ …
scottrod
  • 477
  • 1
  • 8
  • 21
0
votes
1 answer

Dynamically Load Astro Page From Glob

I have a site with over 15,000 static pages. I am able to load them individually using a url no problem. I would like to implement a "Random" page, where I would pick a random identifier from a pre-existing search index, and then use that to load…
Sagebrush GIS
  • 207
  • 4
  • 14
0
votes
1 answer

Astro Build Error, Markdown with Typescript

When I try to build my Astro Project with npm run build or go to one of my markdown pages after running: npm run dev I run into this Error: > astro-blog-template@0.0.1 build > astro build 17:42:55 [build] output target: static 17:42:55 [build]…
Felkru
  • 310
  • 2
  • 12
0
votes
0 answers

Astrojs react get input-text value

I'm trying to make a search box in Astrojs react with to my .include().map() filter in posts.astro file. I already tried to using document.document.getElementById('searchinput').value(document undefind) or write…
codingcat
  • 13
  • 2
0
votes
1 answer

Astro.js is not correctly importing functions

I am brand new to Astro.js. I've tried several ways to import a "global" function on another page but I always get an error saying the function "is not defined". Here is my code from the master/global layout page... export function test1() { …
tvwxyz
  • 195
  • 3
  • 14
0
votes
1 answer

Astro: Failed to load resource: net::ERR_CONNECTION_REFUSED with React(Next.js) And no they do not repeat the same errors

So I have an Astro project with integrations with vue, svelte, react, and tailwindcss. And I suddenly got the errors:Failed to load resource: net::ERR_CONNECTION_RESET, Failed to load resource: net::ERR_CONNECTION_REFUSED, And another Failed to load…
0
votes
1 answer

Are there any type definitions for JSX in astro?

@typescript-eslint/no-unsafe-return rule doesn't work well with .astro files, because the return type of any jsx is any, so any .map results in no-unsafe-return rule error. --- const cards = [ { href:"https://docs.astro.build/", …
Temoncher
  • 644
  • 5
  • 15