Is it possible to compile a project using `Deno.connectTlsalpnProtocols` (unstable API)?

error: Module not found
^ This is the error I get when I try to run my compiled program. Not sure if the unstable API is the issue or something else.
4 Replies
netop://ウィビ
I thought it might have been an issue with importing an npm package but I just finished refactoring it into my app. Issue still persists.
netop://ウィビ
My only dependencies are Deno's standard library and https://github.com/edgedb/edgedb-deno
GitHub
GitHub - edgedb/edgedb-deno: EdgeDB driver for Deno
EdgeDB driver for Deno. Contribute to edgedb/edgedb-deno development by creating an account on GitHub.
netop://ウィビ
I think I know that the problem is. Unfortunately I'm not able to get actionable data as to why there's a module missing but I did get a tiny bit of "aha!" when deploying my Deno project yesterday. The import map is the issue. Rather, anything that starts with a forward slash. So, the compiled app, for whatever reason, thinks you want to access the filesystem at large and not the modules within the app. AHA! I was right So, here's my import_map.json:
{
"imports": {
"/": "./",
"./": "./",
"std/": "https://deno.land/std@0.166.0/"
}
}
{
"imports": {
"/": "./",
"./": "./",
"std/": "https://deno.land/std@0.166.0/"
}
}
I was importing something from std/ like:
import { Buffer } from "std/node/internal/buffer.mjs";
import { Buffer } from "std/node/internal/buffer.mjs";
Once I replaced that with
import { Buffer } from "https://deno.land/std@0.166.0/node/internal/buffer.mjs";
import { Buffer } from "https://deno.land/std@0.166.0/node/internal/buffer.mjs";
my issues disappeared and now my compiled app works Kinda annoying import maps don't work with compiled apps but I'm glad I figured that out

Did you find this page helpful?