Skip to content

Websocket does not work in vite dev mode with bun runtime #3939

Description

@bondehagen

Environment

Nitro 3.0.1-alpha.1
Bun 1.3.5

Reproduction

vite.config.ts

import { defineConfig } from "vite";
import { nitro } from "nitro/vite";

export default defineConfig({
  plugins: [nitro()],
  nitro: {
    preset: "bun",
    features: { websocket: true }
  }
});

package.json

{
  "type": "module",
  "scripts": {
    "dev": "bun --bun vite dev"
  },
  "devDependencies": {
    "nitro": "3.0.1-alpha.1",
    "vite": "npm:rolldown-vite"
  }
}

Describe the bug

36 | const nodeAdapter = (options = {}) => {
37 |     throw new Error(
               ^
error: [crossws] Using Node.js adapter in an incompatible environment.
      at nodeAdapter

Additional context

No response

Logs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions