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

deno emit does not support dynamic imports and npm dependencies so can't be used with oak #660

Open
garethj2 opened this issue Jun 15, 2024 · 1 comment
Labels

Comments

@garethj2
Copy link

I've noticed a few things with Oak that prevent it from cleanly being bundled using deno emit.

One is the use of dynamic imports. See line 704 in https://github.com/oakserver/oak/blob/main/application.ts...

if (!NativeRequestCtor) {
  const { NativeRequest } = await import("./http_server_native_request.ts");
  NativeRequestCtor = NativeRequest;
}

Another problem is the use of npm: in https://github.com/oakserver/oak/blob/main/deps.ts. This second issue isn't a problem with Oak per say but rather the lack of support for processing npm: specifiers in Deno's core caching packages that emit uses. I've raised this as a separate issue but have raised this here just to keep everyone aware.

The first issues creates an runtime error when running Deno from a bundle. The second issue prevents the bundle from ever happening in the first place.

@garethj2 garethj2 changed the title Oak unable to be bundled in Deno emit Oak unable to be bundled using Deno emit Jun 15, 2024
@kitsonk kitsonk changed the title Oak unable to be bundled using Deno emit deno emit does not support dynamic imports and npm dependencies so can't be used with oak Jun 16, 2024
@kitsonk
Copy link
Collaborator

kitsonk commented Jun 16, 2024

oak requires use of dynamic imports in order to support multiple runtimes. Deno Deploy creates a bundle of all code, including dynamic imports, to be able to support deployments. deno emit should also support the same level of functionality, so there is nothing for oak to address.

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

No branches or pull requests

2 participants