vue-worker icon indicating copy to clipboard operation
vue-worker copied to clipboard

Uncaught ReferenceError: xxx is not defined

Open ZengTianShengZ opened this issue 4 years ago • 2 comments

// worker.js

const add = (a, b) => {
    return a + b
}

export const testfun = (a, b) => {
   return add(a, b)
}

import { testfun } from './worker.js';

const r = await this..$worker.run(testfun, [1,2]);

I get this:

Uncaught ReferenceError: add is not defined

ZengTianShengZ avatar Feb 28 '20 11:02 ZengTianShengZ

I have the same problem with you, have you solved this problem?

xiangsanliu avatar Jun 18 '20 07:06 xiangsanliu

// worker.js

const add = (a, b) => {
    return a + b
}

export const testfun = (a, b) => {
   return add(a, b)
}
import { testfun } from './worker.js';

const r = await this..$worker.run(testfun, [1,2]);

I get this:

Uncaught ReferenceError: add is not defined

have you checked without add() that is also not working ?

export const testfun = (a, b) => {
   return (a+b);
}

hamelraj89 avatar Sep 03 '20 05:09 hamelraj89