Skip to content

Commit 510f4d8

Browse files
committed
fix: 🐛 node fetch issue resolved
1 parent 65f8854 commit 510f4d8

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed

package-lock.json

Lines changed: 18 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contentstack",
3-
"version": "3.13.0",
3+
"version": "3.13.1",
44
"description": "Contentstack Javascript SDK",
55
"homepage": "https://www.contentstack.com/",
66
"author": {
@@ -22,7 +22,8 @@
2222
"buildnativescript": "webpack --config webpack/webpack.nativescript.js",
2323
"build": "NODE_ENV=production && npm run buildnode && npm run buildweb && npm run buildreactnative && npm run buildnativescript",
2424
"generate-docs": "node_modules/.bin/jsdoc --configure docs-config.json --verbose",
25-
"prepare": "npm run build"
25+
"prepare": "npm run build",
26+
"pretest": "npm run build"
2627
},
2728
"repository": {
2829
"type": "git",
@@ -99,7 +100,7 @@
99100
"dependencies": {
100101
"@contentstack/utils": "1.0.0",
101102
"es6-promise": "4.1.1",
102-
"localStorage": "1.0.3",
103-
"node-fetch": "^2.6.1"
103+
"isomorphic-fetch": "^3.0.0",
104+
"localStorage": "1.0.3"
104105
}
105106
}

src/runtime/web/http.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import ES6Promise from 'es6-promise';
2-
import fetch from 'node-fetch';
3-
2+
import fetch from 'isomorphic-fetch';
43
ES6Promise.polyfill();
54

65
export default fetch;

src/runtime/web/localstorage.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// export default window.localStorage;
1+
export default window.localStorage;
22

3-
let webLocalStoreage = function (){
4-
try {
5-
var storage = window.localStorage
6-
// x = '__storage_test__';
7-
// storage.setItem(x, x);
8-
// storage.removeItem(x);
9-
return storage;
10-
} catch(e) {
11-
return null
12-
}
13-
};
3+
// let webLocalStoreage = function (){
4+
// try {
5+
// var storage = window.localStorage
6+
// // x = '__storage_test__';
7+
// // storage.setItem(x, x);
8+
// // storage.removeItem(x);
9+
// return storage;
10+
// } catch(e) {
11+
// return null
12+
// }
13+
// };
1414

15-
export default webLocalStoreage();
15+
// export default webLocalStoreage();
1616

0 commit comments

Comments
 (0)