<p dir="auto">My <code class="notranslate">mod.ts</code> is simply:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  /// &lt;reference lib=&quot;dom&quot; /&gt;               
                                                                       
  export function example(): number {
    return 42;
  }"><pre class="notranslate"><code class="notranslate">  /// &lt;reference lib="dom" /&gt;               
                                                                       
  export function example(): number {
    return 42;
  }
</code></pre></div>
<p dir="auto">and test file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  import { assertEquals } from &quot;../deps.ts&quot;;
  import { example } from &quot;../src/mod.ts&quot;;
                                                                                                
  Deno.test({
    name: &quot;example test&quot;,
    fn(): void {
      // Arrange
      const expectedResult = 42;
      // Act
      const result = example();
      // Assert
      assertEquals(result, expectedResult);
    },
  });"><pre class="notranslate"><code class="notranslate">  import { assertEquals } from "../deps.ts";
  import { example } from "../src/mod.ts";
                                                                                                
  Deno.test({
    name: "example test",
    fn(): void {
      // Arrange
      const expectedResult = 42;
      // Act
      const result = example();
      // Assert
      assertEquals(result, expectedResult);
    },
  });
</code></pre></div>
<p dir="auto">Without <code class="notranslate">  /// &lt;reference lib="dom" /&gt;</code> it works great, with I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: CompileError, Global, Instance, LinkError, Memory, Module, RuntimeError, Table, ImportExportKind, TableKind, ValueType, ExportValue, Exports, ImportValue, ModuleImports, Imports, BufferSource, MessageEvent, ErrorEvent, Worker, PerformanceEntryList, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, CustomEvent
interface Account {
~~~~~~~~~
    at asset:///lib.dom.d.ts:25:1

    Conflicts are in this file.
    declare namespace WebAssembly {
    ~~~~~~~
        at asset:///lib.deno.shared_globals.d.ts:15:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: DOMException, Event, EventTarget, EventListenerOrEventListenerObject, ProgressEvent, TextDecoder, TextEncoder, AbortController
interface Account {
~~~~~~~~~
    at asset:///lib.dom.d.ts:25:1

    Conflicts are in this file.
    declare class DOMException extends Error {
    ~~~~~~~
        at asset:///lib.deno.web.d.ts:8:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: ReadableStreamReader, CountQueuingStrategy, ByteLengthQueuingStrategy, BlobPart, Blob, File, FormDataEntryValue, FormData, HeadersInit, Headers, RequestInfo, RequestCache, RequestCredentials, RequestMode, RequestRedirect, ReferrerPolicy, BodyInit, RequestDestination, Request, ResponseType, Response
interface Account {
~~~~~~~~~
    at asset:///lib.dom.d.ts:25:1

    Conflicts are in this file.
    interface DomIterable&lt;K, V&gt; {
    ~~~~~~~~~
        at asset:///lib.deno.fetch.d.ts:8:1

TS2300 [ERROR]: Duplicate identifier 'CloseEvent'.
interface CloseEvent extends Event {
          ~~~~~~~~~~
    at asset:///lib.dom.d.ts:3642:11

    'CloseEvent' was also declared here.
    declare class CloseEvent extends Event {
                  ~~~~~~~~~~
        at asset:///lib.deno.websocket.d.ts:14:15

TS2300 [ERROR]: Duplicate identifier 'CloseEvent'.
declare var CloseEvent: {
            ~~~~~~~~~~
    at asset:///lib.dom.d.ts:3657:13

    'CloseEvent' was also declared here.
    declare class CloseEvent extends Event {
                  ~~~~~~~~~~
        at asset:///lib.deno.websocket.d.ts:14:15

TS2300 [ERROR]: Duplicate identifier 'Location'.
interface Location {
          ~~~~~~~~
    at asset:///lib.dom.d.ts:9794:11

    'Location' was also declared here.
    declare class Location {
                  ~~~~~~~~
        at asset:///lib.deno.window.d.ts:70:15"><pre class="notranslate"><code class="notranslate">error: TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: CompileError, Global, Instance, LinkError, Memory, Module, RuntimeError, Table, ImportExportKind, TableKind, ValueType, ExportValue, Exports, ImportValue, ModuleImports, Imports, BufferSource, MessageEvent, ErrorEvent, Worker, PerformanceEntryList, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, CustomEvent
interface Account {
~~~~~~~~~
    at asset:///lib.dom.d.ts:25:1

    Conflicts are in this file.
    declare namespace WebAssembly {
    ~~~~~~~
        at asset:///lib.deno.shared_globals.d.ts:15:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: DOMException, Event, EventTarget, EventListenerOrEventListenerObject, ProgressEvent, TextDecoder, TextEncoder, AbortController
interface Account {
~~~~~~~~~
    at asset:///lib.dom.d.ts:25:1

    Conflicts are in this file.
    declare class DOMException extends Error {
    ~~~~~~~
        at asset:///lib.deno.web.d.ts:8:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: ReadableStreamReader, CountQueuingStrategy, ByteLengthQueuingStrategy, BlobPart, Blob, File, FormDataEntryValue, FormData, HeadersInit, Headers, RequestInfo, RequestCache, RequestCredentials, RequestMode, RequestRedirect, ReferrerPolicy, BodyInit, RequestDestination, Request, ResponseType, Response
interface Account {
~~~~~~~~~
    at asset:///lib.dom.d.ts:25:1

    Conflicts are in this file.
    interface DomIterable&lt;K, V&gt; {
    ~~~~~~~~~
        at asset:///lib.deno.fetch.d.ts:8:1

TS2300 [ERROR]: Duplicate identifier 'CloseEvent'.
interface CloseEvent extends Event {
          ~~~~~~~~~~
    at asset:///lib.dom.d.ts:3642:11

    'CloseEvent' was also declared here.
    declare class CloseEvent extends Event {
                  ~~~~~~~~~~
        at asset:///lib.deno.websocket.d.ts:14:15

TS2300 [ERROR]: Duplicate identifier 'CloseEvent'.
declare var CloseEvent: {
            ~~~~~~~~~~
    at asset:///lib.dom.d.ts:3657:13

    'CloseEvent' was also declared here.
    declare class CloseEvent extends Event {
                  ~~~~~~~~~~
        at asset:///lib.deno.websocket.d.ts:14:15

TS2300 [ERROR]: Duplicate identifier 'Location'.
interface Location {
          ~~~~~~~~
    at asset:///lib.dom.d.ts:9794:11

    'Location' was also declared here.
    declare class Location {
                  ~~~~~~~~
        at asset:///lib.deno.window.d.ts:70:15
</code></pre></div>
<p dir="auto">... and it goes on</p>
<p dir="auto">I don't see why this is not working, <code class="notranslate">mod.ts</code> will be for the browser using the DOM.</p>
<p dir="auto">Any updates?</p>
<p dir="auto">I got a lot of ts errors when I used <code class="notranslate">@deno-types</code> to include type definitions for the <a href="https://github.com/sindresorhus/ky">ky</a> libarry.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// @deno-types=&quot;https://deno.land/x/ky@v0.23.0/index.d.ts&quot;
export { default as ky } from &quot;https://deno.land/x/ky@v0.23.0/index.js"><pre class="notranslate"><code class="notranslate">// @deno-types="https://deno.land/x/ky@v0.23.0/index.d.ts"
export { default as ky } from "https://deno.land/x/ky@v0.23.0/index.js
</code></pre></div>
<p dir="auto">From the error message, it is the <code class="notranslate">lib.dom.d.ts</code> which causes conflicts with other definitions.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TS2300 [ERROR]: Duplicate identifier 'Event'.
declare class Event {
              ~~~~~
    at asset:///lib.deno.web.d.ts:21:15

    'Event' was also declared here.
    interface Event {
              ~~~~~
        at asset:///lib.dom.d.ts:5285:11    and here.
    declare var Event: {
                ~~~~~
        at asset:///lib.dom.d.ts:5353:13
..."><pre class="notranslate"><code class="notranslate">TS2300 [ERROR]: Duplicate identifier 'Event'.
declare class Event {
              ~~~~~
    at asset:///lib.deno.web.d.ts:21:15

    'Event' was also declared here.
    interface Event {
              ~~~~~
        at asset:///lib.dom.d.ts:5285:11    and here.
    declare var Event: {
                ~~~~~
        at asset:///lib.dom.d.ts:5353:13
...
</code></pre></div>
<p dir="auto"><em>Originally posted by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cj1128/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cj1128">@cj1128</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="552527682" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/3726" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/3726/hovercard?comment_id=714194714&amp;comment_type=issue_comment" href="https://github.com/denoland/deno/issues/3726#issuecomment-714194714">#3726 (comment)</a></em></p>