Skip to content

Deno object in local edge functions does not contain all props #120

@vladgardus

Description

@vladgardus

Describe the bug
I'm trying to upload a file via a POST request using oak on my local edge functions and while trying to read the form data I get the following error: Deno.makeTempDir is not a function.

This is how I'm trying to read the form data: const data = await ctx.request.body({ type: 'form-data' }).value.read();, where ctx is the RouterContext provided by oak.

While doing some debugging I ended up logging the entire Deno object and this is the result:

{
  listen: [Function: listen],
  connect: [AsyncFunction: connect],
  connectTls: [AsyncFunction: connectTls],
  startTls: [AsyncFunction: startTls],
  resolveDns: [AsyncFunction: resolveDns],
  serveHttp: [Function: serveHttp],
  permissions: Permissions {},
  Permissions: [Class: Permissions],
  PermissionStatus: [Class: PermissionStatus],
  errors: {
    Interrupted: [Class: Interrupted],
    BadResource: [Class: BadResource],
    InvalidWorkerResponse: [Class: classErr] { getName: [Function (anonymous)] },
    InvalidWorkerCreation: [Class: classErr] { getName: [Function (anonymous)] },
    NotFound: [Class: classErr] { getName: [Function (anonymous)] },
    PermissionDenied: [Class: classErr] { getName: [Function (anonymous)] },
    ConnectionRefused: [Class: classErr] { getName: [Function (anonymous)] },
    ConnectionReset: [Class: classErr] { getName: [Function (anonymous)] },
    ConnectionAborted: [Class: classErr] { getName: [Function (anonymous)] },
    NotConnected: [Class: classErr] { getName: [Function (anonymous)] },
    AddrInUse: [Class: classErr] { getName: [Function (anonymous)] },
    AddrNotAvailable: [Class: classErr] { getName: [Function (anonymous)] },
    BrokenPipe: [Class: classErr] { getName: [Function (anonymous)] },
    AlreadyExists: [Class: classErr] { getName: [Function (anonymous)] },
    InvalidData: [Class: classErr] { getName: [Function (anonymous)] },
    TimedOut: [Class: classErr] { getName: [Function (anonymous)] },
    WriteZero: [Class: classErr] { getName: [Function (anonymous)] },
    WouldBlock: [Class: classErr] { getName: [Function (anonymous)] },
    UnexpectedEof: [Class: classErr] { getName: [Function (anonymous)] },
    Http: [Class: classErr] { getName: [Function (anonymous)] },
    Busy: [Class: classErr] { getName: [Function (anonymous)] },
    NotSupported: [Class: classErr] { getName: [Function (anonymous)] }
  },
  build: {
    target: "x86_64-unknown-linux-gnu",
    arch: "x86_64",
    os: "linux",
    vendor: "unknown",
    env: "gnu"
  },
  env: {
    get: [Function: getEnv],
    toObject: [Function: toObject],
    set: [Function: setEnv],
    has: [Function: has],
    delete: [Function: deleteEnv]
  },
  pid: undefined,
  args: [],
  mainModule: [Getter/Setter]
}

As you can see, there are a lot of missing properties/methods from the Deno object.

Is this intended?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions