deno_emit icon indicating copy to clipboard operation
deno_emit copied to clipboard

Unable to output during bundling: load_transformed failed: failed to analyze module: failed to resolve node:fs

Open jkilzi opened this issue 7 months ago • 0 comments

Hi, it seems like deno_emit fails to handle node:* specifiers. Here is a repro:

// main.ts
import * as fs from 'node:fs';

fs.writeFileSync('message.txt', 'Hello world!');
// _bundler.ts
import { bundle } from 'jsr:@deno/emit';

const [mod] = Deno.args;
const { code } = await bundle(mod);
const bytes = new TextEncoder().encode(code);
const location = import.meta.resolve(mod).replace(/\.ts$/, '.js');
Deno.writeFileSync(location, bytes);

Execute it with: deno run -A _bundler.ts main.ts

jkilzi avatar Jul 18 '24 22:07 jkilzi