Skip to content

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

@garethj2

Description

@garethj2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions