Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESM distributable client is missing non-minified version #4731

Closed
FossPrime opened this issue Jun 2, 2023 · 1 comment
Closed

ESM distributable client is missing non-minified version #4731

FossPrime opened this issue Jun 2, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@FossPrime
Copy link
Contributor

FossPrime commented Jun 2, 2023

Describe the bug
There is no debuggable ESM distributable... making debugging extremely difficult in some situations... like StackBlitz, where WS inspector and source map file loader in DevTools won't work as they are provided by a service worker. Bundling it ourselves with a service worker doesn't solve the problem... we need an ESM debuggle package hosted somewhere. we cannot load ...?module due to node dependencies in package.json (ws and xml).

To Reproduce

Please fill the following code example:

Socket.IO client version: 4.6.2

Client

import io from 'https://unpkg.com/socket.io-client@4.6.2/dist/socket.io.esm.js';

Expected behavior
Load as normal, with debug logging calls.

Platform:

  • Device: Yes
  • OS: Yes

Additional context
Chrome has a bug where DevTools can't load file based source maps from a service worker. Easy fix is to just point to unpackage... but there is no ESM option.

https://bugs.chromium.org/p/chromium/issues/detail?id=1206431#c13

@FossPrime FossPrime added the to triage Waiting to be triaged by a member of the team label Jun 2, 2023
darrachequesne pushed a commit to socketio/socket.io-client that referenced this issue Jun 20, 2023
So that debug logs can be printed with vite:

```js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  server: {
    port: 4000
  },
  resolve: {
    conditions: ["development"]
  }
})
```

Reference: https://v2.vitejs.dev/config/#resolve-conditions

Related:

- socketio/socket.io#4731
- socketio/socket.io#4635
- https://github.com/socketio/socket.io-client/issues/1516
@darrachequesne darrachequesne added enhancement New feature or request and removed to triage Waiting to be triaged by a member of the team labels Jun 20, 2023
@darrachequesne darrachequesne added this to the 4.7.0 milestone Jun 20, 2023
@darrachequesne
Copy link
Member

This should be fixed by socketio/socket.io-client@781d753, included in version 4.7.0.

Please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants