1 year ago

#77493

test-img

Noor

Cannot import a node module inside a module web worker on the browser

1- I am trying to import a node module into my worker. I could not find a way to get it done in a straightforward manner. Many people were suggesting using things like webpack or external libraries. Why can't I simply import the node module like a regular js module import like so?

import blazeface from '@tensorflow-models/blazeface';

meanwhile, I can import other modules I created like

import getDetectedFace from "./detectFace.js";
  1. When this error occurs I do not see any output to the console that an error has occurred. I can only tell because my worker does nothing when I try this type of import. Is this normal?

javascript

node-modules

web-worker

worker

0 Answers

Your Answer

Accepted video resources