Skip to content

Unhandled Promise Rejection on static site #1710

@Serhioromano

Description

@Serhioromano

What version of Elysia is running?

[email protected]

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What environment are you using

1.3.5

Are you using dynamic mode?

no

What steps can reproduce the bug?

Create a simple app

import { staticPlugin } from "@elysiajs/static"
import { Elysia } from "elysia"

const app = new Elysia()

app.use(staticPlugin({ assets: "ui", prefix: "ui" }))
app.get("/api/*", (ctx) => {
    console.log(ctx.path)
    return { hello: "New API!" }
})
app.listen(3000)

Create file ui/index.html in the root of the project.

Start application and open http://localhost:3000/ui

You will see

Image

What is the expected behavior?

Everything actually works just this annoying banner.

What do you see instead?

No response

Additional information

I know I can suppress that with production NODE_ENV variable, but error is still there in console.

Have you try removing the node_modules and bun.lockb and try again yet?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions