Skip to content

main.ts imports removed std@0.125.0 http/server.ts:serve — breaks deno task start on Deno 2.x #448

Description

@chirag127

Problem

main.ts imports serve from deno.land/std@0.125.0/http/server.ts (Feb 2022). The std serve function was deprecated then removed; Dockerfile pins denoland/deno:latest (Deno 2.x), so deno task start fails or emits a deprecation warning against a URL that will 404 once the std release is pruned.

Steps

  1. docker build -t trophy .
  2. docker run --rm -e PORT=8080 trophy (equivalent to deno task start per CONTRIBUTING.md).

Expected

Server listens on :8080.

Actual

Deprecation warning on the std@0.125.0/http/server.ts import; the serve(handler, opts) shape is the legacy one.

Cite

  • main.ts:1import { serve } from "https://deno.land/std@0.125.0/http/server.ts";
  • Dockerfile:1FROM denoland/deno:latest
  • CONTRIBUTING.md env: Deno >= v1.36.1

Fix

Replace with builtin Deno.serve(...); drops the std dep entirely.

Environment

OS: Linux (container), Deno: latest (2.x), std pin: 0.125.0

Thanks for maintaining ryo-ma/github-profile-trophy!

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