Imports

esdev finds ./util for util.ts, a directory for its index.ts, and ./util.js for the util.ts that TypeScript tells you to spell that way. That is what esdev build already does, so a source tree written for a build step runs under the runner without being rewritten first.

esrun resolves only what the module spec says — which is Node's answer too, since an extensionless specifier was never valid ESM and extension guessing is a bundler convention. The artifact you deploy has been through a build, which resolved all of it, so ship the build rather than the source.

import { two } from "./util"
esdev, Bun, a bundlerresolves util.ts
esrun, NodeERR_MODULE_NOT_FOUND
Last updated on
Edit this page