denoland / denoland/dnt

TextEncoder/TextDecoder not yet available

Open
#185 5 comments 1 reaction 0 assignees View on GitHub
has workaround upstream
Dominant language
Rust
Stars
1.3k
Forks
49
PR merge metrics
No merged PRs in 30d

Description

First of all, thank you for the great work behind DNT and Deno itself!

`TextDecoder` and `TextEncoder` cannot be used yet to compile to NPM modules. I know it is expected, just adding for reference.

Source:

```ts
const hexDecode = (s: string) => new TextEncoder().encode(s);

console.log(hexDecode("1234"));
```

Build output:

```
[dnt] Building project...
[dnt] Type checking...
src/mod.ts:9:38 - error TS2304: Cannot find name 'TextEncoder'.

9 const hexDecode = (s: string) => new TextEncoder().encode(s);
~~~~~~~~~~~

error: Uncaught (in promise) Error: Had 1 diagnostics.
throw new Error(`Had ${diagnostics.length} diagnostics.`);
^
at build (https://deno.land/x/dnt@0.27.0/mod.ts:299:15)
```

Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.