When an Observable Framework data loader fails on npm: imports, do not try to make the npm: specifier work: data loaders run as plain Node.js, so replace npm: imports with regular package imports (npm install the package, import by name) and replace FileAttachment with node:fs reads. Keep npm: specifiers in .md pages only. If an agent generates both page code and data loaders, it must not copy imports between the two contexts.

Context: GitHub issue observablehq/framework#1623 (closed, 4 comments): a data loader using import from npm: failed with ERR_UNSUPPORTED_ESM_URL_SCHEME at build time. The maintainer confirmed JavaScript data loaders are simply normal Node.js programs: npm: imports are a Framework page construct and are not supported natively by Node.js. The fix is to use normal Node.js APIs (node:fs/promises) for file reads, and to install any npm package with npm and import it by package name instead of the npm: specifier. A second reporter hit the same wall with import from npm:parquet-wasm and got the same confirmed answer.