-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[v0.81.0] worker_threads doesn't work with node.js in nwjs #8082
Comments
Hey there, just chiming in to say I ran into the same issue. Web Workers did work for me though, so if you need to run another thread desperately you can do that. I'm not sure of the performance differences but that was the only way I could open a new thread. |
Hey, thanks for your reply. Maybe I'm being a little silly but can you share a little more of the solution. Because with version 0.65.1 everything worked and with the latest version it doesn't work anymore. Thanks already for your time. |
Hello @helloitsian, I change the Code:
But unfortunately this does not result in any change. |
I believe @helloitsian was suggesting you use web workers that are already built-in to the browser context. You would not be able to launch them via |
Thanks for the clarification. I have then misunderstood. |
It works for me with 0.79.0 on Linux. |
Hey, Thanks for your reply and the test. I have tested it on WIN 10 and 11 unfortunately with a crash |
I'm also seeing this crash in Windows 10 with 0.78.1 and 0.79.0. Min. repro: package.json {
"name": "test",
"main": "main.html",
"node-main": "node-main.js",
"chromium-args": "--enable-logging=stderr"
} main.html
node-main.js const wt = require('node:worker_threads');
try {
console.log('starting worker');
let w = new wt.Worker("./workerFile.js");
} catch (err) {
console.log(err);
} workerFile.js console.log("in Node.js worker");
const fs=require('fs');
fs.writeFileSync('output.txt', "hello world"); The "starting worker" log is shown, then NW.js crashes with no errors. EDIT: The above code works without any issues in macOS. |
I was testing with the code you provided in the first post.
…On Mon, Aug 21, 2023 at 4:12 AM Matt-Maerz ***@***.***> wrote:
It works for me with 0.79.0 on Linux.
Hey, Thanks for your reply and the test.
Just to be sure again, no offense intended, have you tested NodeJS's
worker_threads?
https://nodejs.org/api/worker_threads.html
I have tested it on WIN 10 and 11 unfortunately with a crash
I will then test it right away on Steamdeck's Linux.
—
Reply to this email directly, view it on GitHub
<#8082 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABIMGI2ZNDEOLEGUWJM5KDXWMX7ZANCNFSM6AAAAAAZYYITIQ>
.
You are receiving this because you were assigned.Message ID: <nwjs/nw.
***@***.***>
|
Ok, thank you very much. That means it is even more difficult to create a fix for this. Is there any crash report in win10/win11 from nwjs where you can still possibly see the error? Or are there noticeable differences/hints if you look at the version differences at |
@rogerwang If you need any information, let me know. My reason is the WebGPU support from chrome 113 (https://developer.chrome.com/blog/webgpu-release/) |
This is fixed in git and will be available in the next nightly build. |
I tested it and it works again! |
Issue Type
Current/Missing Behavior
Same like: #7114
With version 0.81.0 the app crashes without any errors. It started with version v0.69.1, see below
I have used the attached example, just remove the *.txt extension from the files
It is exactly the example from here #7114 (comment)
An HTML and a Server.js is loaded. In the Server.js a Worker is called.
The Worker writes a txt file with Hello World
index.html.txt
package.json.txt
Server.js.txt
workerFile.js.txt
Additional Info
0.81.0 ⛔ (Crash)
0.80.0 ⛔
0.79.1 ⛔
0.79.0 ⛔
0.78.1 ⛔
0.78.0 ⛔
0.77.0 ⛔
0.76.1 ⛔
0.76.0 ⛔
0.75.0 ⛔
0.74.0 ⛔
0.73.0 ⛔
0.72.0 ⛔
0.71.0 ⛔
0.70.1 ⛔
0.70.0 ⛔
0.69.1 ⛔
0.69.0 ✅
0.68.1 ✅
0.68.0 ✅
0.67.0 ✅
0.66.0 ✅
0.65.1 ✅ (no Crash)
The text was updated successfully, but these errors were encountered: