Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jkilzi opened this issue Jul 18, 2024 · 0 comments

Comments

@jkilzi
Copy link

jkilzi commented Jul 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant