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

Dev Console got http://localhost:3000/socket.io/socket.io.js is being assigned a //# sourceMappingURL, but already has one #3958

Closed
xreider opened this issue Jun 4, 2021 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@xreider
Copy link

xreider commented Jun 4, 2021

Describe the bug
Dev Console got http://localhost:3000/socket.io/socket.io.js is being assigned a //# sourceMappingURL, but already has one

To Reproduce

Socket.IO server version:"socket.io": "^4.1.2",

Server

const { io } = require('./app', {
  // allowEIO3: true, // false by default
});
io.on('connection', socket => {
  console.log('IO connected');
});

Socket.IO server version:"socket.io": "^4.1.2",

Client

client side pug

script(src='/socket.io/socket.io.js')
script.
  const socket = io();
  //- socket.on('hello', function (data) {
  //-   console.log(data);
  //- });
script(src='/bundles/bundle.js') // generated by web pack
@xreider xreider added the bug Something isn't working label Jun 4, 2021
@darrachequesne
Copy link
Member

I guess that's because we have both:

  • the sourcemap field in the bundle

//# sourceMappingURL=socket.io.min.js.map

  • and the X-SourceMap header

res.setHeader("X-SourceMap", filename.substring(1) + ".map");

I think we could remove the header now.

darrachequesne added a commit that referenced this issue Jul 3, 2021
This header is useless, as the client bundle already contains a
sourceMappingURL field.

Besides, Firefox prints the following warning:

> <url> is being assigned a //# sourceMappingURL, but already has one

Related: #3958
@darrachequesne
Copy link
Member

This should be fixed by a4dffc6, included in socket.io@4.1.3.

Thanks!

@darrachequesne darrachequesne added this to the 4.1.3 milestone Jul 14, 2021
dzad pushed a commit to dzad/socket.io that referenced this issue May 29, 2023
This header is useless, as the client bundle already contains a
sourceMappingURL field.

Besides, Firefox prints the following warning:

> <url> is being assigned a //# sourceMappingURL, but already has one

Related: socketio#3958
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants