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

Embed directories Error with --compile #17433

Open
souhype opened this issue Feb 18, 2025 · 0 comments
Open

Embed directories Error with --compile #17433

souhype opened this issue Feb 18, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@souhype
Copy link

souhype commented Feb 18, 2025

What version of Bun is running?

1.2.3-canary.110+32c17d865

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

// index.ts
import icon from "./public/assets/icon.ico" with { type: "file" };
import { file } from "bun";

export default {
  fetch(req) {
    // Embedded files can be streamed from Response objects
    return new Response(file(icon));
  },
};
bun build --compile ./index.ts ./public/**/*.png

What is the expected behavior?

Embed the files from the directory

What do you see instead?

error: ModuleNotFound resolving "./public/**/*.png" (entry point)

Additional information

Tried the example from: https://bun.sh/docs/bundler/executables#embed-directories

@souhype souhype added bug Something isn't working needs triage labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant