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

Intellisense not working in VS Code, even though the browser seems to work with the code #3591

Closed
1 of 2 tasks
OSG-Proj opened this issue May 1, 2020 · 3 comments
Closed
1 of 2 tasks

Comments

@OSG-Proj
Copy link

OSG-Proj commented May 1, 2020

Note: for support questions, please use one of these channels: stackoverflow or slack

For bug reports and feature requests for the Swift client, please open an issue there.

For bug reports and feature requests for the Java client, please open an issue there.

You want to:

  • report a bug
  • request a feature

Current behaviour

What is actually happening?
When I try doing es6 module import on the browser using import io from 'socket.io-client'
For some reason it comes from a typescript definition file and the browser says the module is not found. I am trying to get intellisense working for socket.io itself but none of the code inside socket.io.js in socket.io-client/dist/ is showing up on intellisense

Steps to reproduce (if the current behaviour is a bug)

Remake socket.io-client into a es6 module format by using the export syntax.
Note: the best way (and by that we mean the only way) to get a quick answer is to provide a failing test case by forking the following fiddle.

Expected behaviour

What is expected?
For socket.io.js to automatically load intellisense

Setup

  • OS: Windows 10
  • browser: Chrome and all others
  • socket.io version: 2.3.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)

@OSG-Proj
Copy link
Author

I found out why a long while ago anyway, thats because the code that is embedded into the browser is actually a bundled version of all the modules in the lib folder of the socket.io-client, so basically, you just need to import them as a module and use webpack. The intellisense actually comes from a ts declaration file but webpack can let you import modules from the node_modules folder as the name of the folder in node_modules and even though the module uses module.exports, you can still use the es6 import method for some reason

@darrachequesne
Copy link
Member

Is this fixed in v3.0.0?

@darrachequesne
Copy link
Member

That should be fixed in latest version, please reopen if needed.

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

No branches or pull requests

2 participants