CloudCannon/bookshop

Bookshop Browser v3.10.0 is broken for Astro projects

Opened this issue ยท 0 comments

It appears that the Bookshop Browser won't run in an Astro project in v3.10.0 (perhaps other SSGs, untested).

Steps to recreate

  1. Create a new Astro project with default setup
  2. Add Bookshop v3.10.0 as per these docs
  3. Add the sample component
  4. Try to run Bookshop Browser with npx @bookshop/browser

Following error message:

๐Ÿ“š Looking for Bookshop component libraries...
๐Ÿ“š โ€”โ€” Loading Bookshop from ./src
 > src/components/sample/sample.bookshop.yml:4:12: error: Expected ";" but found "Component"
    4 โ”‚   label: My Component
      โ•ต             ~~~~~~~~~

/Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:1493
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
src/components/sample/sample.bookshop.yml:4:12: error: Expected ";" but found "Component"
    at failureErrorWithLog (/Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:1493:15)
    at /Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:1151:28
    at runOnEndCallbacks (/Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:941:63)
    at buildResponseToResult (/Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:1149:7)
    at /Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:1258:14
    at /Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:629:9
    at handleIncomingPacket (/Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:726:9)
    at Socket.readFromStdout (/Users/adonmoskal/astro-bookshop/node_modules/@bookshop/builder/node_modules/esbuild/lib/main.js:596:7)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:559:12) {
  errors: [
    {
      detail: undefined,
      location: {
        column: 12,
        file: 'src/components/sample/sample.bookshop.yml',
        length: 9,
        line: 4,
        lineText: '  label: My Component',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Expected ";" but found "Component"'
    }
  ],
  warnings: []
}

Node.js v20.12.2

Reverting Bookshop back to v3.9.0 works.