developit / developit/greenlet

_ref not defined in Create react app.

Open
#41 4 comments 11 reactions 0 assignees View on GitHub
has fix question
Dominant language
JavaScript
Stars
4.7k
Forks
97
PR merge metrics
No merged PRs in 30d

Description

We are planning to use greenlet to defer expensive computations to web worker in CRA project ( along with Type script ). To test it out I was playing around with a small example.

**greenlet-helpers.ts**

```
import greenlet from 'greenlet';

export const greenletRead = greenlet(async msg => {
return msg;
});
```

**utils.ts**
```
import { greenletRead } from './greenlet-helpers';

try {
const resp = await greenletRead('Hey from greenlet');
console.log(resp);
} catch (e) {
console.log('Exception', e);
}
```

Running into `_ref is not defined` when ever this gets invoked. It would be great if I can get any pointers to get this started.

P.S. I also tried moving the code snippet from `greenlet-helpers` to `uitils` and still running into the same issue.

**utils.ts**
```
import greenlet from 'greenlet';

try {
const greenletRead = greenlet(async msg => {
return msg;
});

const resp = await greenletRead('Hey from greenlet');
console.log(resp);
} catch (e) {
console.log('Exception', e);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.