useWorker icon indicating copy to clipboard operation
useWorker copied to clipboard

Uncaught ReferenceError: f is not defined

Open monski opened this issue 1 year ago • 3 comments

Hello,

Using create-react-app when developing npm start the library works fine. But then when i build it i got this error

Uncaught ReferenceError: f is not defined

heres is the sample code

const processData = (xlsData: string[]): Promise<ProcessedData> => new Promise((resolve, reject) => {

const arrangeData: ArrangeData[] = [];

xlsData.forEach((data: RowData, forIndex: number, arr: any) => { ... if (forIndex === arr.length - 1) { resolve({ arrangeData, groups }); } }); });

const [processWorkers] = useWorkers(processData);

//on Click const process = async (): void => { const { arrangeData, groups } = await processWorkers(data); .... }`

can you help me with this?

thank you in advance

monski avatar Mar 23 '23 12:03 monski

I also have this issue, any idea? I'm using [email protected]

Isaac96SM avatar May 10 '23 14:05 Isaac96SM

Same problem

Arima666 avatar May 10 '24 08:05 Arima666

Don't use Promise in worker

BitBrewing avatar Jul 02 '24 02:07 BitBrewing