Skip to content

Troubleshooting

Solutions for common issues in Velocity.

Clear and reinstall dependencies:

Terminal window
rm -rf node_modules pnpm-lock.yaml
pnpm install

Astro 6 requires Node.js 22.12.0+:

Terminal window
node --version # Should be 22.12.0 or higher
# Using nvm
nvm install 22
nvm use 22
  1. Check that global.css is imported in your layout
  2. Ensure the file is in Tailwind’s content paths
  3. For scoped styles, use @reference:
<style>
@reference "../../styles/global.css";
h1 { @apply text-2xl; }
</style>

Regenerate types:

Terminal window
pnpm astro sync
  1. Check that dimensions are valid (1200x630 recommended)
  2. Ensure fonts are available
  3. Check build logs for errors
Terminal window
pnpm build 2>&1 | grep -i error

Try restarting the dev server:

Terminal window
# Stop with Ctrl+C
pnpm dev

Update types:

Terminal window
pnpm astro sync
pnpm check

Check tsconfig.json:

{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}

Use <style> without is:global:

<style>
/* These styles are scoped */
.my-class { color: red; }
</style>

Add a client directive:

<Counter client:visible />
<Modal client:load />

Use absolute paths from public/ or import:

---
import myImage from '@/assets/image.png';
---
<img src={myImage.src} alt="Description" />
  1. Ensure variables are set in hosting dashboard
  2. Redeploy after adding variables
  3. Check PUBLIC_ prefix for client-side variables

Check that your hosting provider supports Node.js 22+.

Set in your hosting configuration:

NODE_VERSION=22

For static hosting, ensure trailingSlash is configured:

astro.config.mjs
export default defineConfig({
trailingSlash: 'always', // or 'never'
});