Skip to content

Deno: Usage of deprecated API with >= Deno 1.40 #3609

@marvinhagemeister

Description

@marvinhagemeister

With the recent Deno 1.40 release some older APIs were marked as deprecated. Some of those are used within the deno esbuild adapter and print warning messages to the terminal.

Stack trace:
  at https://deno.land/x/[email protected]/mod.js:1888:45
  at eventLoopTick (ext:core/01_core.js:59:7)
  at async file:///Users/marvinh/dev/test/esbuild-deprecations/foo.ts:3:1

hint: Use `Deno.stderr` instance methods instead.
hint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency.

warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2.

Stack trace:
  at https://deno.land/x/[email protected]/mod.js:1888:26
  at eventLoopTick (ext:core/01_core.js:59:7)
  at async file:///Users/marvinh/dev/test/esbuild-deprecations/foo.ts:3:1

hint: Use `Deno.stdin.isTerminal()`, `Deno.stdout.isTerminal()` or `Deno.stderr.isTerminal()` instead.
hint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency.

warning: Use of deprecated "Deno.run()" API. This API will be removed in Deno 2.

Stack trace:
  at https://deno.land/x/[email protected]/mod.js:1889:26
  at eventLoopTick (ext:core/01_core.js:59:7)
  at async file:///Users/marvinh/dev/test/esbuild-deprecations/foo.ts:3:1

hint: Use "Deno.Command()" API instead.
hint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency.

Steps to reproduce

  1. Upgrade Deno to 1.40.1 deno upgrade
  2. Create a file foo.ts with these contents:
import * as esbuild from "https://deno.land/x/[email protected]/mod.js";

await esbuild.build({
  entryPoints: ["foo"],
  bundle: true,
  plugins: [
    {
      name: "foo-entry",
      setup(build) {
        build.onResolve({ filter: /foo/ }, (args) => {
          return { path: args.path, namespace: "foo" };
        });

        build.onLoad({ filter: /.*/, namespace: "foo" }, () => {
          return { contents: "export default 42;", loader: "ts" };
        });
      },
    },
  ],
});

esbuild.stop();
  1. Run deno run -A foo.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions