@sitecore-jss/sitecore-jss-nextjs 21.7.0-canary.46 → 21.7.0-canary.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,10 +57,16 @@ class Context {
57
57
  * @returns {void}
58
58
  */
59
59
  initSDK(name) {
60
- this.sdkPromises[name] = new Promise((resolve) => {
61
- this.props.sdks[name].init(this).then(() => {
60
+ this.sdkPromises[name] = new Promise((resolve, reject) => {
61
+ this.props.sdks[name]
62
+ .init(this)
63
+ .then(() => {
62
64
  this.sdks[name] = this.props.sdks[name].sdk;
63
65
  resolve(this.sdks[name]);
66
+ })
67
+ .catch((e) => {
68
+ // if init rejects, getSDK will reject too now
69
+ reject(e);
64
70
  });
65
71
  });
66
72
  }
@@ -54,10 +54,16 @@ export class Context {
54
54
  * @returns {void}
55
55
  */
56
56
  initSDK(name) {
57
- this.sdkPromises[name] = new Promise((resolve) => {
58
- this.props.sdks[name].init(this).then(() => {
57
+ this.sdkPromises[name] = new Promise((resolve, reject) => {
58
+ this.props.sdks[name]
59
+ .init(this)
60
+ .then(() => {
59
61
  this.sdks[name] = this.props.sdks[name].sdk;
60
62
  resolve(this.sdks[name]);
63
+ })
64
+ .catch((e) => {
65
+ // if init rejects, getSDK will reject too now
66
+ reject(e);
61
67
  });
62
68
  });
63
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-jss/sitecore-jss-nextjs",
3
- "version": "21.7.0-canary.46",
3
+ "version": "21.7.0-canary.48",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -72,9 +72,9 @@
72
72
  "react-dom": "^18.2.0"
73
73
  },
74
74
  "dependencies": {
75
- "@sitecore-jss/sitecore-jss": "^21.7.0-canary.46",
76
- "@sitecore-jss/sitecore-jss-dev-tools": "^21.7.0-canary.46",
77
- "@sitecore-jss/sitecore-jss-react": "^21.7.0-canary.46",
75
+ "@sitecore-jss/sitecore-jss": "^21.7.0-canary.48",
76
+ "@sitecore-jss/sitecore-jss-dev-tools": "^21.7.0-canary.48",
77
+ "@sitecore-jss/sitecore-jss-react": "^21.7.0-canary.48",
78
78
  "@vercel/kv": "^0.2.1",
79
79
  "node-html-parser": "^6.1.4",
80
80
  "prop-types": "^15.8.1",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "description": "",
85
85
  "types": "types/index.d.ts",
86
- "gitHead": "8811d850aa209764e49bd9077303e1a1c4662ff5",
86
+ "gitHead": "c2be192618caf1ffde2f22123c422f43e645f693",
87
87
  "files": [
88
88
  "dist",
89
89
  "types",