deno: const enum error clarification

This error appears after I switched to Deno 1.4.1 and fixed all the import type errors.


image

Skillz@Home Discordeno % deno run --allow-net --allow-read --unstable debug.ts
error: Uncaught ReferenceError: RequestMethod is not defined
    return runMethod(RequestMethod.Get, url, body);
                     ^
    at Object.get (requestManager.ts:124:22)
    at createClient (client.ts:44:41)
    at debug.ts:10:1
  get: async (url: string, body?: unknown) => {
    return runMethod(RequestMethod.Get, url, body);
  },

image

image

Also of note VSC shows 0 errors image

Alternative Fix: (to just removing const) image

Reason(By Kit ❤️): const enum are not supportable in a --no-check situation, and so in Deno 1.4.0+ we switched on the isolatedModules flag with --unstable to help folks ensure their code was “no check” safe.

Can we get a better error message for this please. Confused me like crazy! Although im always confused so… hahaha

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@tbillington That has not yet made it into the TS release currently in Deno. Will be a few more weeks before we have it.