You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works perfectly in the main thread.
Now try this in a Worker, and you will get a crash (limited to the worker and recoverable).
What is the expected behavior?
No crash when importing a native module.
What do you see instead?
The same import in a Worker file has less success:
67 | "the addon module, please check " +
68 | "https://github.com/tensorflow/tfjs/blob/master/tfjs-node/" +
69 | "WINDOWS_TROUBLESHOOTING.md or file an issue.");
70 | }
71 | // tslint:disable-next-line:no-require-imports
72 | var bindings = require(bindingPath);
^
TypeError: symbol 'napi_register_module_v1' not found in native module. Is this a Node API (napi) module?
at <anonymous> (/node_modules/@tensorflow/tfjs-node/dist/index.js:72:16)
Additional information
This might be related to #4290, however since this issue does not mention workers, and since it works fine unless running in a worker, I thought it might be a separate issue and hopefully a low-hanging fruit.
Edit: the same problem was reported here #5578 (comment) but the Issue was closed in favor of the aforementioned one, but since this is a particular issue with workers I think we could have a dedicated issue.
The text was updated successfully, but these errors were encountered:
toverux
changed the title
Native NAPI module not working only in a Worker thread
Native NAPI module cannot be required only in a Worker thread
Apr 28, 2025
What version of Bun is running?
1.2.10+db2e7d7f7
What platform is your computer?
Linux 6.14.0-15-generic x86_64 x86_64
What steps can reproduce the bug?
In any file, import:
This works perfectly in the main thread.
Now try this in a Worker, and you will get a crash (limited to the worker and recoverable).
What is the expected behavior?
No crash when importing a native module.
What do you see instead?
The same import in a Worker file has less success:
Additional information
This might be related to #4290, however since this issue does not mention workers, and since it works fine unless running in a worker, I thought it might be a separate issue and hopefully a low-hanging fruit.
Edit: the same problem was reported here #5578 (comment) but the Issue was closed in favor of the aforementioned one, but since this is a particular issue with workers I think we could have a dedicated issue.
The text was updated successfully, but these errors were encountered: