Skip to content

ERROR TypeError: Object(...) is not a function on Angular #3

@Razkaroth

Description

@Razkaroth

Hi, when running test1() I get the following error: ERROR TypeError: Object(...) is not a function refering to $worker().

Here's the code for test1(). It's the example code provided on the README.md

import {$worker} from 'inline-web-worker';

test1() {
    const myWorker = $worker().create(function() {
      self.postMessage('Hello World');
    });

// run the worker respond to the promise
    myWorker.run().then(function(e) {
      console.log(e.data); // 'Hello World'
    });
  }

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions