Closed brandon-vb closed 6 years ago
Currently there is no web worker option for BRFv4. I might look into it at some point.
Hi there. I just succeeded in running BRFv4 (trial version) in web workers.
BRFv4_JS_TK101018_v4.1.0_trial.js
needs os
and https
modules in runtime, So I added following lines to top of files.
// BRFv4_JS_TK101018_v4.1.0_trial.js`
require('os')
require('https')
export function initializeBRF(brfv4) { /* function implementation */ }
// "export" statement enable to calling this function from another module when imported.
In worker, just import this file.
// myWorker.js
import { initializeBRF } from './BRFv4_JS_TK101018_v4.1.0_trial'
Made in this, initializeBRF can be called from worker and works fine.
Note: To using require, import, and export statement need webpack tools like babel. (I'm using parcel)
MarcelKlammer, Thank you for creating the great library.
Seeing comparable behavior to that described in: https://github.com/Tastenkunst/brfv4_javascript_examples/issues/1
Like described in issue #1 , we see the error "ReferenceError: Can't find variable: require".
Was there ever progress made on the resolution of this issue?