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
1
vote
1 answer

PostCSS Autoprefixer Setup in an Astro Project

What I'm trying to achieve Set up automated autoprefixer on npm run build of an Astro project on all global stylesheets and component scoped styling to support other browsers and older browsers (up to about 2016). My build Astro v1.9.1 CSS compiled…
Lushawn
  • 522
  • 1
  • 3
  • 17
1
vote
1 answer

Error when building Astro project to Netlify: The argument 'filename' must be a file URL object

I am trying to build an astro project to Netlify (dev) however I keep getting this error: TypeError: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined at new NodeError…
Usayd
  • 21
  • 2
1
vote
1 answer

Astrojs: How can I get a component to appear as inline text in an MDX file?

Question: In the screenshot below, I want the first line to appear exactly as the second line. Is there a way to do this in Astrojs? Here is my full reproduction on Codesandbox. Here is what the output looks like (see below). Notice how the period…
Jesse Good
  • 50,901
  • 14
  • 124
  • 166
1
vote
3 answers

React Query does not work with Astro Framework

I'm trying to use React-Query with Astro to fetch data from my Django Rest Framework backend. Astro has been a great way to organize my react-based frontend but I am worried it might not be compatible with React-Query. Whenever I try to make a query…
chenard612
  • 101
  • 2
  • 15
1
vote
1 answer

Generate Astro index page as well as pagination

I have a static site with a blog section using Astro's built-in pagination, doing something like this in src/pages/blog/[page].astro: export const itemsPerPage = 12 export async function getStaticPaths({ paginate }) { const allBlogs = await…
velvetkevorkian
  • 660
  • 1
  • 5
  • 13
1
vote
1 answer

How was the Astro CLI wizard made?

So I started playing around with Astro and noticed the interactive CLI wizard that guides you through the setup steps after using npm create astro@latest is really nice, works well and actually looks good! Does anyone know how it was made? Was there…
1
vote
1 answer

How to render multiple Markdown files on one page in Astro?

I want to render the contents of multiple .md files on a single page using Astro. I have this file structure: pages/ items/ item-1.md item-2.md item-3.md // etc index.astro item-1.md looks like this: --- title = 'Item…
Santa
  • 43
  • 4
1
vote
0 answers

Loading PostCSS Plugin failed: Cannot find module 'fast-glob'

I was trying Astro build for the very first time. I follow the documentation and create an Astro app with npm create astro@latest and then npm install but when trying to run a server with npm run dev I am getting this error: Loading PostCSS Plugin…
Mohammad Farhan
  • 131
  • 1
  • 8
1
vote
1 answer

Single page with Astro and Netlify CMS

I’m trying to create a Single page with astro and netlify cms, in which the admin should be able to add/remove/modify the page through /admin, but I’m struggling with the understanding of the folder structure. So, as far as I know, I need to specify…
Don_Huan
  • 85
  • 2
  • 10
1
vote
0 answers

Separate CSS files for multi-page app in Astro with Tailwind

I have 6 pages in astro with tailwind which combines css from all pages into a single css file of ~75KB. I need to split it and reduce the css file size for each page load. Is there any way to achieve it?
Srini
  • 111
  • 1
  • 8
1
vote
2 answers

User Swiper.js in Astro.build

Please can anyone help me how I can use swiper or any other slider in astro.build? Like we use in react.
1
vote
1 answer

error: [astro preview] adapter does not have previewentrypoint

I've been making a website with astro (https://astro.build) and after some time, while running astro preview it errors. Here's my astro.config.mjs code: import { defineConfig } from 'astro/config'; import vercel from…
Zepvil
  • 75
  • 2
  • 6
1
vote
2 answers

How access environment variables from a Framework Components in Astro?

I'm working in a project using Astro and I am using a component with VUE. For this project I need to access some env vars. I am able to access from the Astro templates, but I can't find a way to get in the VUE component. Is this possible?
1
vote
1 answer

Astro - TypeError: Cannot read properties of undefined (reading 'document')

I am moving my blog to Astro and wanted to import some javascript using jquery. In the Layout file I first import the jquery file (3.6.1) and then import my javascript file. --- import "../scripts/jquery.js"; import…
MGA
  • 23
  • 5
0
votes
1 answer

Astro v3 images in frontmatter not loading

I'm rebuilding my personal website in Astro, and I'm facing this issue with frontmatter in MDX files and images. Images are correctly loaded when referenced in the markdown text, but are not loaded when referenced in the frontmatter. In one of my…
Drago96
  • 1,265
  • 10
  • 19