DataProvider does not work with web worker

Aperta
#59 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
react, typescript

Direzione di ricerca

Start by reproducing the DataProvider worker failure with examples/react-worker-app and inspect the FlowmapLayer.ts call site named in the traceback, along with the Comlink message path. Determine why the callback cannot be cloned; done means the worker example initializes without DataCloneError in the reported browsers.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi there and thanks for sharing this amazing library

I have a question tho. I'm trying to put the data provider into a web worker, but I have the following error. Then I've tried to use the example from examples/react-worker-app, but got the same error.

Could it be that some API was changed so it does not work with workers anymore?

comlink.ts:636 Uncaught (in promise) DataCloneError: Failed to execute 'postMessage' on 'MessagePort': (layersData) => {
          this.setState({ layersData, highlightedObject: void 0 });
        } could not be cloned.
    at comlink.ts:636:8
    at new Promise (<anonymous>)
    at requestResponseMessage (comlink.ts:630:10)
    at Object.apply (comlink.ts:530:14)
    at FlowmapLayer.updateState (FlowmapLayer.ts:267:22)
    at FlowmapLayer._update (layer.ts:944:14)
    at FlowmapLayer._initialize (layer.ts:886:10)
    at LayerManager._initializeLayer (layer-manager.ts:339:13)
    at LayerManager._updateSublayersRecursively (layer-manager.ts:303:16)
    at LayerManager._updateLayers (layer-manager.ts:258:10)

In Firefox the traceback is similar

Uncaught (in promise) DOMException: Function object could not be cloned.
    requestResponseMessage comlink.ts:613
    requestResponseMessage comlink.ts:601
    apply comlink.ts:504
    updateState FlowmapLayer.ts:267
    _update layer.ts:944
    _initialize layer.ts:886
    _initializeLayer layer-manager.ts:339
    _updateSublayersRecursively layer-manager.ts:303
    _updateLayers layer-manager.ts:258
    setLayers layer-manager.ts:206
    updateLayers layer-manager.ts:218
    _onRenderFrame deck.ts:1032
    onRender animation-loop.js:269
    _renderFrame animation-loop.js:370
    redraw animation-loop.js:191
    renderFrame animation-loop.js:297
    requestAnimationFrame2 request-animation-frame.js:5
    _requestAnimationFrame animation-loop.js:355
    _startLoop animation-loop.js:303
    startPromise animation-loop.js:168
    promise callback*start animation-loop.js:164
    Deck deck.ts:383
    createDeckInstance deckgl.ts:98
    DeckGL deckgl.ts:202
    React 7
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    js scheduler.development.js:571
    js scheduler.development.js:633
    __require chunk-5WWUZCGV.js:8
    js index.js:6
    __require chunk-5WWUZCGV.js:8
    React 2
    __require chunk-5WWUZCGV.js:8
    js React
    __require chunk-5WWUZCGV.js:8
    js React
    __require chunk-5WWUZCGV.js:8
    <anonymous> react-dom_client.js:38
Lingua principale
TypeScript
Stelle
143
Fork
24
Merge medio
1g 4h
PR unite (30g)
18

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di visgl/flowmap.gl

Tutte le issue di visgl/flowmap.gl

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.