You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Babel and Typescript in development, which I compile to JS for production. However, when trying to use microjob with an async function working locally I get a _functionName is not defined error.
Here is some simple code to reproduce:
//index.tsimportexpressfrom"express";import{job,start}from"microjob";constapp=express();app.get("/",asyncfunction(req: express.Request,res: express.Response){awaitstart();consttest=async()=>{return'test';}// all the below fail with the async before the function name above// const result = await job(test);// const result = await job(() => {// return test();// }, { ctx: { test }});constresult=awaitjob(async()=>{returntest();},{ctx: { test }});// const result = await job(async () => {// const response = await test();// return response;// }, { ctx: { test }});res.send(result);});constport=4790;app.listen(port);console.log(`view app at http://localhost:${port}`);
Hi,
I'm using Babel and Typescript in development, which I compile to JS for production. However, when trying to use microjob with an async function working locally I get a
_functionName is not defined
error.Here is some simple code to reproduce:
My package.json:
.babelrc
My tsconfig.json
Node version 12.6.2
To note: Using an async function passed
Thanks for any help in advance 👍
The text was updated successfully, but these errors were encountered: