Skip to content

Commit

Permalink
Update node fetch require for vercel compat (#164)
Browse files Browse the repository at this point in the history
* Update node fetch require for vercel compat

* jkw doesnt like the variable name
  • Loading branch information
tore-statsig authored May 11, 2022
1 parent 9b5c0f5 commit 2c30e5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "statsig-node",
"version": "4.15.2",
"version": "4.15.3",
"description": "Statsig Node.js SDK for usage in multi-user server environments.",
"main": "dist/src/index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/utils/safeFetch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
let nodeFetch = null;
try {
nodeFetch = require('node-fetch');
} catch(err) {
var webpackBypass = '';
nodeFetch = require(`node-fetch${webpackBypass}`);
} catch (err) {
// Ignore
}

Expand Down

0 comments on commit 2c30e5d

Please sign in to comment.