Sb-object-id not found when using Git CMS and Astro in Netlify Create

Current setup:

  • (Site is currently running locally through Netlify Create)
  • Running Astro 4.2.1
  • Using Git CMS in Netlify Create
  • Attempting to port existing Astro website to Netlify Create

The Issue

I am struggling to get inline editing to work with the Astro setup. After following the Git CMS instructions for inline editing for a file that is in this location:

src/test_pages/test.json

<div data-sb-object-id="src/test_pages/test.json"></div>

However, I am getting an AnnotationError:

AnnotationError: Object src/test_pages/test.json defined in sb-object-id not found

For reference, the file is loaded successfully using GitContentSource in the config:

import { defineStackbitConfig } from "@stackbit/types";
import { GitContentSource } from "@stackbit/cms-git";

export default defineStackbitConfig({
    stackbitVersion: '~0.6.0',
    ssgName: 'custom',
    // customContentReload: true,
    devCommand: './node_modules/.bin/astro dev --port {PORT}',
    contentSources: [
        new GitContentSource({
            rootPath: __dirname,
            contentDirs: ["src/test_pages"],
            assetsConfig: {
                referenceType: "relative",
                assetsDir: "src",
                uploadDir: "images"
            },
            models: [
                {
                    name: "page",
                    type: "page",
                    urlPath: "/{title}",
                    // hideContent: true,
                    filePath: "{slug}.json",
                    fields: [
                        { name: "title", type: "string", required: true },
                        { name: "subtitle", type: "string", required: true },
                    ]
                }
            ],
        })
    ]
});

What I have tried

I am sure I am probably just forgetting something simple here. I appreciate any help!

Escaping backslashes works:

<div data-sb-object-id="src\\test_pages\\test.json"></div>
1 Like