CloudCannon / bookshop

📚 A component development workflow for static websites.
MIT License
247 stars 21 forks source link

error: No loader is configured for ".yml" files #179

Closed silveltman closed 9 months ago

silveltman commented 9 months ago

Just this this setup for loading yml files in astro. Build works locally, but I get the following error on CloudCannon during the postbuild:

> src/components/elements/button/Button.astro:2:21: error: No loader is configured for ".yml" files: src/data/elements.yml
    2 │ import elements from "@data/elements.yml";

Does this problem come from the same place as this issue, bookshop not having access to files?

It seems weird to me since all component are files right? And importing component in one another works fine

Tate-CC commented 9 months ago

Hi again @silveltman

The problem here is that you're using a build plugin to load the yml file as part of your Astro build. Previously when Bookshop built it didn't have any awareness of these custom build plugins and so would fail when trying to resolve an import that needed a custom loader.

As of yesterday's release of Bookshop 3.9.0, the build process will now try and fall back to using your custom loaders when it finds a file that it can't load by default. This should mean that you can now load yml files with a build plugin in Bookshop components without issue.