You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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';
I think exposing the browser ESM bundle through a dedicated subpath makes sense. We could add a socket.io-client/browser export pointing to dist/socket.io.esm.min.js with the existing ESM declarations, so Deno users can import io directly from the npm package without copying the generated file locally:
Activity
sakgoyal commentedon Aug 28, 2025
maybe by adding a new tsconfig like
tsconfig.esm.jsoncalledtsconfig.browser.esm.jsonbut make it ES2020 and use bundler, instead of node module resolution
darrachequesne commentedon Sep 29, 2026
I think exposing the browser ESM bundle through a dedicated subpath makes sense. We could add a socket.io-client/browser export pointing to
dist/socket.io.esm.min.jswith the existing ESM declarations, so Deno users can import io directly from the npm package without copying the generated file locally:and then
import { io } from 'socket.io-client/browser';What do you think?
sakgoyal commentedon Sep 29, 2026
yep makes sense. that should work