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
my-project-name/node_modules/@pooltogether/v4-client-js/dist/v4-client-js.cjs.development.js:2072
return fetch(this.getDrawResultsStatusUrl(chainId, prizeDistributorAddress, drawId));
^
ReferenceError: fetch is not defined
Expected behavior
The expected behavior was to get draw results of a user
How I quickly fix this to make it works
Run npm i node-fetch
Add these lines at the beginning of my entry index.js file
Additional context
I believe this error is occurring because the client is being run in a Node.js environment instead of a browser. However, this issue may be resolved with the new Node.js v18 version, as they have introduced a fetch API. It is also worth noting that the package.json file indicates that the client should work on Node.js versions equal to or greater than 16.
The text was updated successfully, but these errors were encountered:
Describe the bug
When running the client in a Node.js environment, the
fetch is not defined
error occurs while trying to get draw results.To Reproduce
Steps to reproduce the behavior:
getUsersDrawResultsForDrawId()
(see this tutorial at step 6.3)Expected behavior
The expected behavior was to get draw results of a user
How I quickly fix this to make it works
npm i node-fetch
Desktop
Additional context
I believe this error is occurring because the client is being run in a Node.js environment instead of a browser. However, this issue may be resolved with the new Node.js v18 version, as they have introduced a fetch API. It is also worth noting that the
package.json
file indicates that the client should work on Node.js versions equal to or greater than 16.The text was updated successfully, but these errors were encountered: