@cocreate/lazy-loader 1.20.4 → 1.20.5

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.20.5](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.20.4...v1.20.5) (2024-08-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * try catch dependency ([70b10f5](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/70b10f546bba430aea32c206bcb033945d986842))
7
+
1
8
  ## [1.20.4](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.20.3...v1.20.4) (2024-06-30)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/lazy-loader",
3
- "version": "1.20.4",
3
+ "version": "1.20.5",
4
4
  "description": "A simple lazy-loader component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "lazy-loader",
package/src/client.js CHANGED
@@ -61,12 +61,16 @@ export async function lazyLoad(name, selector, callback) {
61
61
  }
62
62
 
63
63
  export async function dependency(name, promise) {
64
- let component = await promise;
65
- if (!window.CoCreate)
66
- window.CoCreate = {}
64
+ try {
65
+ let component = await promise;
66
+ if (!window.CoCreate)
67
+ window.CoCreate = {}
67
68
 
68
- window.CoCreate[name] = component.default || component
69
- dispatchComponentLoaded(name)
69
+ window.CoCreate[name] = component.default || component
70
+ dispatchComponentLoaded(name)
71
+ } catch (error) {
72
+ console.error('error loading chunck: ', error)
73
+ }
70
74
  }
71
75
 
72
76
  function dispatchComponentLoaded(name) {