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

compiled exectuable can't fetch embedded files #28129

Open
sigmaSd opened this issue Feb 15, 2025 · 0 comments
Open

compiled exectuable can't fetch embedded files #28129

sigmaSd opened this issue Feb 15, 2025 · 0 comments
Labels
bug Something isn't working correctly compile related to the `deno compile` feature

Comments

@sigmaSd
Copy link
Contributor

sigmaSd commented Feb 15, 2025

Version: Deno 2.1.10

touch a.ts b.txt

a.ts

Deno.readTextFileSync(new URL("./b.txt", import.meta.url)); // works
await fetch(new URL("./b.txt", import.meta.url)); // doesn't work
deno -A a.ts # works

deno compile -A --include b.txt a.ts

Check file:///home/mrcool/dev/deno/lab/bug/a.ts
Compile file:///home/mrcool/dev/deno/lab/bug/a.ts to a

Embedded Files

a
├── a.ts (45B)
└── b.txt (0B)

Size: 45B

./a
error: Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource
await fetch(new URL("./b.txt", import.meta.url));
      ^
    at opFetchSend (ext:deno_fetch/26_fetch.js:90:10)
    at mainFetch (ext:deno_fetch/26_fetch.js:189:18)
    at ext:deno_fetch/26_fetch.js:408:11
    at new Promise (<anonymous>)
    at fetch (ext:deno_fetch/26_fetch.js:367:20)
    at file:///tmp/deno-compile-a/a.ts:2:7
@dsherret dsherret added bug Something isn't working correctly compile related to the `deno compile` feature 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 correctly compile related to the `deno compile` feature
Projects
None yet
Development

No branches or pull requests

2 participants