Common Issues
This guide covers common issues you might encounter while working on the FiNAN documentation or website.
Build Failures
Section titled “Build Failures”Missing Assets
Section titled “Missing Assets”If the build fails with an error like Module not found: Error: Can't resolve './image.png', it usually means an image path is incorrect.
Solution:
- Verify the file exists in
src/assets/. - Check for typos in the filename.
- Ensure you are using a relative path (e.g.,
../../assets/image.png) or alias if configured.
Invalid Frontmatter
Section titled “Invalid Frontmatter”All .mdx files in src/content/docs must have valid YAML frontmatter.
Error:
[Astro] content-docs: Invalid frontmatter. "title" is required.Solution: Ensure every file starts with:
---title: Page Titledescription: Brief description---Image Errors
Section titled “Image Errors”Local vs. Public Folder
Section titled “Local vs. Public Folder”Issue: Image not loading or 404 error.
Solution:
- If the image is in
src/assets/, import it in your component or use the relative markdown syntax. - If the image is in
public/, reference it with a leading slash/image.png.
Ghost CMS Issues
Section titled “Ghost CMS Issues”API Key Errors
Section titled “API Key Errors”Issue: “Failed to fetch posts” or “Unauthorized”.
Solution:
- Check your
.envfile. - Ensure
CONTENT_API_KEYandAPI_URLare set correctly. - Restart the dev server (
pnpm dev) after changing.envfiles.
Missing Content
Section titled “Missing Content”Issue: A new post isn’t showing up.
Solution:
- Verify the post is Published (not Draft) in Ghost Admin.
- Check if the post has the correct Tag (e.g.,
#finlandfor the Finland page). - The build is static; you must rebuild the site to fetch new content.
TypeScript Errors
Section titled “TypeScript Errors””Property ‘X’ does not exist on type ‘Y’”
Section titled “”Property ‘X’ does not exist on type ‘Y’””This is common when working with data objects.
Solution:
- Check the relevant type definition in
src/data/. - Ensure your data matches the schema.
- If you added a new property, update the TypeScript interface.
// Example: Updating a typeexport interface CommitteeMember { name: string; role: string; image: ImageMetadata; // Add new optional property linkedinUrl?: string;}