Issue 1:
const [errors, emitted] = await Deno.compile("./app.ts", undefined, {

lib: ["es6","dom", "esnext", "deno.ns","scripthost","dom.iterable"], // include "deno.ns" for deno namespace

outDir: "./",

});

if (errors) {

console.log("There was an error:");

console.log(errors);

} else {

console.log(emitted); // normally we would write the file

}

when i was use Deno.compile case error

{

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

messageChain: {

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

code: 2345,

category: 3,

next: [Array]

},

code: 2345,

category: 3,

startPosition: 12702,

endPosition: 12705,

sourceLine: " return new URL(url).pathname;",

lineNumber: 432,

scriptResourceName: "https://deno.land/std@0.51.0/path/posix.ts",

startColumn: 17,

endColumn: 20

},

{

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

messageChain: {

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

code: 2345,

category: 3,

next: [Array]

},

code: 2345,

category: 3,

startPosition: 27167,

endPosition: 27170,

sourceLine: " return new URL(url).pathname",

lineNumber: 910,

scriptResourceName: "https://deno.land/std@0.51.0/path/win32.ts",

startColumn: 17,

endColumn: 20

},

{

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

messageChain: {

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

code: 2345,

category: 3,

next: [Array]

},

code: 2345,

category: 3,

startPosition: 12702,

endPosition: 12705,

sourceLine: " return new URL(url).pathname;",

lineNumber: 432,

scriptResourceName: "https://deno.land/std@0.52.0/path/posix.ts",

startColumn: 17,

endColumn: 20

},

{

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

messageChain: {

message: "Argument of type 'string | URL' is not assignable to parameter of type 'string'.",

code: 2345,

category: 3,

next: [Array]

},

code: 2345,

category: 3,

startPosition: 27167,

endPosition: 27170,

sourceLine: " return new URL(url).pathname",

lineNumber: 910,

scriptResourceName: "https://deno.land/std@0.52.0/path/win32.ts",

startColumn: 17,

endColumn: 20

}

but if i use deno.run that was no problem , but i want to compile. deno v 1.0.1

Issue 2:
The deno standard lib declaration of URL accepts string | URL as input:

deno/cli/js/lib.deno.shared_globals.d.ts

Line 1149
in
a08a4ab

new (url: string | URL, base?: string | URL): URL;

However the TypeScript dom library declaration only accepts string:

https://github.com/microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts#L15920

When declaring "dom" in tsconfig.json like so:

"lib": ["dom", "dom.iterable", "esnext", "deno.ns"]

deno throws the following 2 errors:

error: TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/std@0.51.0/path/posix.ts:433:18

TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/std@0.51.0/path/win32.ts:911:18

Found 2 errors.

Probably related to #4234.