Skip to content

Commit

Permalink
Pin flowbite due to a bug related to flowbite-datepicker
Browse files Browse the repository at this point in the history
Pin flowbite to v2.3.0 (actually, <2.4.0).

flowbite 2.4.0 changed the way it imported flowbite-datepicker:
- removed `src/plugins` and the related webpack configuration that
  restricted what was actually included from flowbite-datepicker in the
  final flowbite.min.js;
- now includes the entire flowbite-datepicker package in the final
  flowbite.min.js;

flowbite-datepicker has (always had) an issue that causes an SSR
"document is not defined" error due to
[lib/js/jdom.js](https://github.com/themesberg/flowbite-datepicker/blob/a343785aa01c7671f891cacc491040e238c4acc5/js/lib/dom.js#L1):
```javascript
var range = document.createRange();
```

This issue can be easily resolved within flowbite-datepicker by changing
the line to:
```javascript
var range = (typeof document !== 'undefined' && document.createRange());
```

Reported:
- flowbite: [issue 950](themesberg/flowbite#950);
- flowbite-datepicker: added a [comment](themesberg/flowbite-datepicker#41 (comment))
  to an existing, related issue;
  • Loading branch information
depeele committed Aug 22, 2024
1 parent 218f889 commit b63f96d
Show file tree
Hide file tree
Showing 2 changed files with 520 additions and 609 deletions.
Loading

0 comments on commit b63f96d

Please sign in to comment.