Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught ReferenceError: xxx is not defined #23

Open
ZengTianShengZ opened this issue Feb 28, 2020 · 2 comments
Open

Uncaught ReferenceError: xxx is not defined #23

ZengTianShengZ opened this issue Feb 28, 2020 · 2 comments

Comments

@ZengTianShengZ
Copy link

// 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
@xiangsanliu
Copy link

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

@hamelraj89
Copy link

hamelraj89 commented Sep 3, 2020

// 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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants