I must be doing something wrong, something obvious, but I can’t spot the problem. I have the following setup:
games/[game].md is pretty trivial, tries to load a JSON: const game = FileAttachment(`./data/games/${observable.params.game}.json`).json();
data loader, data/games/[game].json.py should supply the JSON data - it works when I run it manually
but, when I open the page, e.g. /games/87, Observable seems never to register the data loader: it’s not triggered, not executed, not mentioned in npm run dev output, and no 87.json file is generated. Page displays “Error: Unable to load file: 87.json” message.
What else can I check? Any hints WRT debugging the problem? Data loaders seem to work in general, I already have some non-parametrized ones, and they work like a charm.
Hi there! Do you mind asking on GitHub instead of the Observable Forum? You can open a discussion in the Q&A section, or file an issue if you’ve found a bug.
This was it! I knew it would be something as trivial as an incorrect path, and I did play a bit with paths, moving files and directories around, but it never occurred to me it’s actually one level below. Thank you!
I’ll switch to absolute paths, I’m not going to have too many nested directories, it will be much easier to maintain.