Skip to content

Commit 6801aac

Browse files
committed
3.7.2 bump - error when fetch is undefined
1 parent 5e5319e commit 6801aac

File tree

12 files changed

+17
-12
lines changed

12 files changed

+17
-12
lines changed

examples/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"flagsmith-es": "3.7.1",
12+
"flagsmith-es": "3.7.2",
1313
"lodash-es": "^4.17.21",
1414
"next": "12.1.0",
1515
"next-transpile-modules": "^9.0.0",

flagsmith-core.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ const Flagsmith = class {
3737
if (headers) {
3838
Object.assign(options.headers, headers)
3939
}
40+
41+
if (!_fetch) {
42+
console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
43+
}
44+
4045
return _fetch(url, options)
4146
.then(res => {
4247
this.log("Fetch response: "+ res.status + " " + (method||"GET") + + " " + url)
@@ -49,7 +54,7 @@ const Flagsmith = class {
4954
return res.ok ? err : Promise.reject(err);
5055
})
5156
}).catch((e)=>{
52-
this.log("Fetch error: "+ e)
57+
console.error("Flagsmith: Fetch error: " + e)
5358
})
5459
};
5560

flagsmith-es/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flagsmith-es/isomorphic.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flagsmith-es/next.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flagsmith-es/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flagsmith-es",
3-
"version": "3.7.1",
3+
"version": "3.7.2",
44
"description": "Feature flagging to support continuous development. This is an esm equivalent of the standard flagsmith npm module.",
55
"main": "./index.js",
66
"type": "module",

flagsmith/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flagsmith/isomorphic.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flagsmith/next-middleware.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flagsmith/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flagsmith",
3-
"version": "3.7.1",
3+
"version": "3.7.2",
44
"description": "Feature flagging to support continuous development",
55
"main": "./index.js",
66
"repository": {

0 commit comments

Comments
 (0)