8000 `status(500, "Error") instanceof ElysiaCustomStatusResponse` is `false` when importing from "elysia" · Issue #1266 · elysiajs/elysia · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content < 8000 /span>
status(500, "Error") instanceof ElysiaCustomStatusResponse is false when importing from "elysia" #1266
Open
@hunterwilhelm

Description

@hunterwilhelm

What version of Elysia is running?

1.3.5

What platform is your computer?

Darwin 24.4.0 arm64 arm

What steps can reproduce the bug?

import { ElysiaCustomStatusResponse, status as statusFromError } from "elysia/error";

console.log(
  "Is statusFromError an instance of ElysiaCustomStatusResponse?",
  statusFromError(500, "Internal Server Error") instanceof
    ElysiaCustomStatusResponse
);
// Is statusFromError an instance of ElysiaCustomStatusResponse? true


import { status as statusFromIndex } from "elysia";
console.log(
  "Is statusFromIndex an instance of ElysiaCustomStatusResponse?",
  statusFromIndex(500, "Internal Server Error") instanceof
    ElysiaCustomStatusResponse
);
// Is statusFromIndex an instance of ElysiaCustomStatusResponse? false

What is the expected behavior?

Is statusFromError an instance of ElysiaCustomStatusResponse? true
Is statusFromIndex an instance of ElysiaCustomStatusResponse? true

What do you see instead?

Is statusFromError an instance of ElysiaCustomStatusResponse? true
Is statusFromIndex an instance of ElysiaCustomStatusResponse? false

Additional information

This isn't a showstopper for me, so no rush. But I wanted to let you know and others know of this behavior. Have a good one 😄

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

yes

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

      0