Skip to content

socket.io-client on the browser #5383

@sakgoyal

Description

@sakgoyal

Describe the bug
I want to be able to import the client version without having to use a bundler / using the serveClient option on the server. Can you just provide an ES2020 module that I can just directly import?

This is when I use the npm package instead of a http import (so I get typescript support).

Expected behavior

// client.ts (bundled for browser)
import { io } from 'socket.io-client/browser';
// ...

What I am currently doing
copying the esm output to a local directory

// client.ts (bundled for browser)
// @ts-types="npm:socket.io-client"
import { io } from './socket.io.esm.min.js';
deno bundle client.ts -o client.js

Platform:

  • Runtime: Deno 2.4.5
  • OS: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    to triageWaiting to be triaged by a member of the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions