Why is my build failing in deno console even when the deno dash is working 100% fine?
02:50 07 Apr 2026

My simple deno script is working at dash.deno.com

/* eslint-disable */
import "https://deno.land/std@0.181.0/dotenv/load.ts";

import { Client } from "https://deno.land/x/mysql/mod.ts";
const client = await new Client().connect({
    hostname: Deno.env.get("DATABASE_HOST"),
    username: Deno.env.get("DATABASE_USER"),
    db: Deno.env.get("DATABASE_NAME"),
    password: Deno.env.get("DATABASE_PASS"),
    port: Deno.env.get("DATABASE_PORT"),
  });

const server = Deno.listen({ port: 8080 });
console.log(`HTTP webserver running. Access it at:  http://localhost:8080/`);

let counter  = 0;

for await (const conn of server)
{
    serveHttp(conn);
}

async function serveHttp(conn: Deno.Conn)
{
    const httpConn = Deno.serveHttp(conn);
    for await (const requestEvent of httpConn)
    {
        counter++;        
        const url = new URL(requestEvent.request.url);

        switch (url.pathname)
        {
            case "/":
            {
                const sentence = url.searchParams.get("sentence");
                const sqlStatus = save2MySQL(sentence);
                console.log(sqlStatus);
                break;
            }

            default:
                requestEvent.respondWith(new Response(counter as unknown as string, { status: 200, }),);
        }
    }
}

async function save2MySQL(sentence: string)
{
    console.log("Attempting to save data to the datbase");
    // ...    
    return result;
}

But Deno Deploy Classic will be shut down on July 20, 2026 and they're migrating to the new Deno Deploy platform.

So I tried to deploy the same GitHub URL (single main-esm.ts file) - I set Entrypoint: main-esm.ts in my deno console settings.

But Deploy always fails - I can't seem to get this simple single file deno file migrated from dash to console.

console deploy screenshot

deno