Ionic + Cpacitor Electron, NAME_NOT_RESOLVED for socket.io requests
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- electron, nodejs, typescript
- Domain
- desktop, networking
Research direction
Start by reproducing the issue with node server.js, the Ionic web app, and the Electron tasks, then inspect /src/pages/Home.tsx and the /electron directory. Done means the Electron version reaches the server without the ERR_NAME_NOT_RESOLVED request failure described in the issue.
Written by the indexing model from the issue text.
Description
Describe the bug
Situation:
I made a repository for testing: https://github.com/ZweiEuro/electron_socket_test
It has:
server.js - minimal socket io server that just console.logs conections. CORS * so that is not an issue. Listening 3002
A minimal ionic blank project with socket-client installed. The web version just prompts for an ip address and tries to connect to it.
Mainly defined in /src/pages/Home.tsx. Always connecting to :3002
A lot of tasks defined for easier debugging.
The ionic project has https://github.com/capacitor-community/electron installed as a platform, it's data is located in /electron. It should behave the same way as the ionic web page
The Problem:
Using the app Web version:
- Running
node server.js - Running
ionic serve - Navigating browser to
http://localhost:8100/home - Entering your machines ip address in the prompt will connect to it
- Console says "connect" both for the server and the web client => works as intended
Using the app electron version:
(Since electron does not support 'prompt' in their window, you need to hard code the address of the server into Home.tsx, if you do this you need to rebuild (run the tasks again)
- Using the tasks "run electron" or "pack electron" (and starting it manually)
- open electron dev tools
- See error
GET http://capacitor-electron/socket.io/?EIO=4&transport=polling&t=OGz8z5U net::ERR_NAME_NOT_RESOLVED
To me it looks like something is getting rewritten incorrectly?
To Reproduce
- clone https://github.com/ZweiEuro/electron_socket_test
npm iin both electron and the root directory- Run the commands listed above, it is easier to start vscode in the directory and using the tasks
- Web version works, electron version throws the above error
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from socketio/socket.io
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 56/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in socketio/socket.io
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·