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

Frontend initialization of electron app fails on Windows when runing the exe via UNC path #13512

Open
aghayanlena opened this issue Mar 21, 2024 · 2 comments
Labels
help wanted issues meant to be picked up, require help messaging issues related to messaging

Comments

@aghayanlena
Copy link

Bug Description:

The initialization of my theia custom electron application fails on Windows when running theia via UNC path. ( --no-sandbox option is presented)
From the Network tab of DevTools the following request is refused:
Request URL: http://<server_name_of_UNC_paht>/socket.io/?EIO=4&transport=polling&t=OvSpqm9

Although, from the logs, it is listening to http://127.0.0.1:<port_number> .
The same request that is addressed to localhost returns the response successfully:
$ curl http://127.0.0.1/:<port_number>/socket.io/?EIO=4&transport=polling
0{"sid":"cx7PqAU7lTT64JufAAAB","upgrades":["websocket"],"pingInterval":30000,"pingTimeout":60000,"maxPayload":100000000}

Steps to Reproduce:

I use the following configuration to build/package my custom theia application:

package.json of electron-app

{
  "private": true,
  "name": "Custom_theia",
  "version": "0.0.1",
  "description": "Custom Theia app",
  "author": "Custom",
  "main": "src-gen/backend/electron-main.js",
  "dependencies": {
    "@theia/core": "1.46.1",
    "@theia/electron": "1.46.1",
    "@theia/preferences": "1.46.1",
    "@theia/filesystem": "1.46.1",
    "@theia/workspace": "1.46.1",
    "@theia/plugin-ext-vscode": "1.46.1",
    "node-gyp": "^9.0.0"
  },
  "devDependencies": {
    "@theia/cli": "latest",
    "electron": "^23.2.4",
    "electron-builder": "^23.0.3",
  },
  "theiaExtensions": [
  ],
  "theiaPluginsDir": "plugins",
  "scripts": {
    "theia_build": "theia build",
    "rebuild_electron": "theia rebuild:electron",
    "build": "yarn theia_build && yarn rebuild_electron",
    "start_win": "theia start --mode=electron --plugins=local-dir:./plugins",
    "start_lin": "theia start --mode=electron --no-sandbox --plugins=local-dir:./plugins",
    "dist": "electron-builder"
  },
  "theia": {
    "target": "electron",
    "frontend": {
      "config": {
        "applicationName": "Custom Theia"
      }
    }
  }
}

electron-builder.json

{
	"appId": "custom.theia",
	"productName": "custom_theia",
	"electronDist": "../node_modules/electron/dist",
        "electronVersion": "23.2.4",
	"asar": false,
	"files": [
		"src-gen",
		"src",
		"lib",
		"!**node_modules/electron/**"
	],
	"extraResources": [
		{
			"from": "./plugins",
			"to": "plugins"
		}
	],
	"win": {
		"executableName": "custom_theia",
		"artifactName": "${productName}_${version}.${ext}",	
		"target": [
			"nsis"
		]
	},
	"linux": {
		"executableName": "custom_theia",
		"artifactName": "${productName}_${version}.${ext}",
		"category": "Development",
		"target": [
			"AppImage"
		]
	},
	"nsis": {
		"oneClick": false,
		"perMachine": false,
		"allowToChangeInstallationDirectory": true,
		"runAfterFinish": false,
		"artifactName": "${productName}_${version}_Setup.${ext}",
		"uninstallDisplayName": "${productName}"
	},
}

Steps to reproduce:

  1. yarn
  2. yarn build
  3. yarn dist
  4. run the generated executable under the dist/win-unpacked directory through the UNC path with the --no-sandbox option.

The front-end does not open successfully; it keeps sending the socket.io request (mentioned in the bug description) forever.

Additional Information

Don't see the same behavior on Linux.

  • Operating System: Windows
  • Theia Version: 1.46.1
@msujew msujew added help wanted issues meant to be picked up, require help messaging issues related to messaging labels Mar 25, 2024
@tsmaeder
Copy link
Contributor

@aghayanlena How does the UNC path get in there? How do you build the executable? Also, could you share the browser and console logs, please?

@aghayanlena
Copy link
Author

Hi @tsmaeder ,

I installed the Theia executable on one of my servers and ran it via the UNC path from another machine.

Those are the steps that I use to generate the package:
$ yarn
$ yarn build
$ yarn dist

You can find the package.json and electron-builder.json files in the bug description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted issues meant to be picked up, require help messaging issues related to messaging
Projects
None yet
Development

No branches or pull requests

3 participants