Skip to content

After using Bun: WebSocket: Unexpected server response: 101 #107

@psteinroe

Description

@psteinroe

Hey,

we had some ESM issues due to the use of __dirname in the connector package, and switched to bun for that reason. now we get WebSocket: Unexpected server response: 101 every 5 seconds, and it cannot establish a connection anymore.

our server is straightforward:

import { Connect, Connection } from 'taskforce-connector';

import { envSchema } from './env';

async function start() {
  const env = envSchema.parse(process.env);

  const redisConnection = {
    host: env.REDIS_HOST,
    port: env.REDIS_PORT,
    username: env.REDIS_USERNAME,
    password: env.REDIS_PASSWORD,
    tls: {},
  };

  Connect(
    env.ENV,
    env.TASKFORCE_API_KEY,
    redisConnection as Connection,
    undefined
  );
}

start().catch((err) => {
  console.error(err);
  process.exit(1);
});

we are deploying to Fargate and connect to Elasticache.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions