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

App Fails to Function Independently On Other Devices After Build: WorkerW not found Error #28

Open
saadaoui-3 opened this issue Dec 23, 2024 · 5 comments

Comments

@saadaoui-3
Copy link

Hi @meslzy,

After building the app, the function attach() fails to execute properly and throws the following error: WorkerW not found

This issue only occurs on my friend's laptop, which does not have Rust or Node.js installed. I am unsure if the error is caused by missing dependencies, such as Rust, VS Code, or Node.js, or if it stems from another problem. However, the expectation is that the app should operate independently after being built, without requiring any additional tools or dependencies on the devices where it is used.

How I Identified the Exception Message

When my friend first tried running the app, it close immediately after launching it.
To debug this, I wrapped critical sections of the code in try-catch blocks and added a custom error handler function, onFatalError. This function logs errors to an external JSON file and gracefully terminates the app. Below is the relevant portion of the code:

app.on('ready', () => {
	try {
		const window = new BrowserWindow({
			skipTaskbar: true,
			fullscreen: true,
			frame: false,
			focusable: false,
			darkTheme: true,
			transparent: true,
			webPreferences: {
				devTools: false,
				contextIsolation: true,
				preload: path.join(__dirname, '/src/preload.js'),
			},
		});

		try {
			attach(window, { forwardMouseInput: true });
		} catch (error) {
			onFatalError('on-attach-window', error);
		}

		onAnyChange();
	} catch (error) {
		onFatalError('on-create-window', error);
	}
});

This setup captured the following error in the log file:

[
	{
		"error": "on-attach-window",
		"timeStamp": "2024-12-23 03-01-27",
		"message": "WorkerW not found"
	}
]

The error message suggests that the problem occurs specifically within the attach() function.

Additional Notes

  • The issue is not caused by the environment or the operating system, as both my friend and I use Windows 11.
  • The only notable difference between the two systems is that my device has Node.js and all the necessary dependencies installed for development, whereas my friend's device does not.
  • Since my friend is an end-user and not a programmer, he should not be required to install development tools like Node.js or Rust for the app to function.

The expectation is that the app should be fully self-contained after being built and should run on any compatible device without additional setup.

@saadaoui-3
Copy link
Author

Update

I installed Node.js and Visual Studio (to set up Rust) on my friend's laptop, but the error persists, so it doesn't appear to be related to missing dependencies as initially suspected.

Additionally, I deleted the node_modules folder and ran npm install and then npm start to test the app in development mode, but the same issue occurred. This indicates that the error is not exclusive to the built version of the app.

@meslzy
Copy link
Owner

meslzy commented Dec 23, 2024

This error is throwing by rust which indicates that all dependencies exists. However, this probably issue with windows.

Maybe I know the?

  • exact version of windows
  • if icons is visible or not

@saadaoui-3
Copy link
Author

saadaoui-3 commented Dec 23, 2024

In my friend's laptop where the error is occurred, it is Windows 11 Home 64-bit (Version 10.0, Build 26100)
For me where everything is working, it's Windows 11 Home 64-bit (Version 10.0, Build 22631)

I dont know what exactly the icons you asked if they are visible are. but if the it is the app icon.
This is the output that i got. it use the default Electron icon in both machines.
image

@meslzy
Copy link
Owner

meslzy commented Dec 25, 2024

I meant the desktop icons. not the app icon. but thank you its more then enough.

@saadaoui-3
Copy link
Author

saadaoui-3 commented Dec 25, 2024

Yes the desktop icons were visible but i had to hide them manually because the wallpaper itself is clickable and i dont want any conflict when clicking, [ so, they are hidden manually ]

In my laptop, they were visible when i was testing, once i finished, i did hide them
but in my friend's laptop i hide them before launching the app without any test

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