observablehq / observablehq/notebook-kit
FileAttachment metadata is missing, and missing files aren’t checked statically
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 371
- Forks
- 27
- Avg merge
- 3h 52m
- Merged PRs (30d)
- 1
Description
We don’t currently do any static analysis of file attachments, and so FileAttachment calls are missing metadata (such as the MIME type and last-modified time), and FileAttachment calls that reference files that don’t exist don’t throw statically (but will still throw when you try to load the associated data).
You do get a warning when building:
new URL("./does-not-exist.txt", import.meta.url) doesn't exist at build time, it will remain unchanged to be resolved at runtime. If this is intended, you can use the /* @vite-ignore */ comment to suppress this warning.
Ideally these would be errors.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the build-time handling for FileAttachment calls and the existing warning for missing new URL references. Trace how attachment metadata and file existence are currently resolved, then verify that missing files and absent metadata produce errors rather than runtime failures or warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100