ccxt
ccxt copied to clipboard
CCXT will not import inside Web Worker
- OS: Mac OS Big Sur
- Programming Language version: JavaScript Vanilla in Browser
- CCXT version: 1.81
CCXT will not import inside Web Worker
// main.js
var w = new Worker( 'worker' , { type:'module'} )
// web_worker.js
import { * as ccxt } from './ccxt.browser.js';
silent fail to load
Hello @psytron,
Please check out this example regarding web workers' usage: https://github.com/ccxt/ccxt/tree/master/examples/html/webworker
Let me know if that does not help.
Thanks @carlosmiei. That example is using old style "importScripts" and requires type:'classic'
New esm style import using Worker( {type:module } ) enable intermixing and importing new es6 modules.
@psytron we are working on adding esm support to ccxt - see #12619, we plan to complete it later this month
In the meantime are solutions like https://esm.sh/ and https://esbuild.github.io/ recommended ?
Is this recommended in the meantime ? https://github.com/carlosmiei/ccxt
Since the migration of ccxt.pro into ccxt, the new browser versions (1.93.100 and higher) won't work in a webworker context anymore.
Any updated thoughts on this? Enabling smooth fast UI and responsive apps would benefit tremendously from ability to offload heavy server communications like ccxt into an independent process ( web worker )
Yes, its working again since the first of november actually.
closing since this has been fixed