Skip to content

fix: isDayjs import usage for ESM#2924

Merged
arnautov-anton merged 2 commits intoGetStream:masterfrom
goldenratio:master
Jan 30, 2026
Merged

fix: isDayjs import usage for ESM#2924
arnautov-anton merged 2 commits intoGetStream:masterfrom
goldenratio:master

Conversation

@goldenratio
Copy link
Contributor

@goldenratio goldenratio commented Jan 29, 2026

🎯 Goal

Describe why we are making this change

recently we moved our stack to ESM (micro frontends, uses import maps). Noticed we are getting below error in the micro-frontend that uses stream-chat-react,

Failed to load module mfe-chat SyntaxError: The requested module 'dayjs' does not provide an export named 'isDayjs' (at index.umd-ce148d01.js:18:14)

on further investigation, found:

  • isDayjs is actually not exported in dayjs esm build. It needs to be accessed to through dayjs instance.
  • We are using importmap (esm), to satisfy dayjs dependency, this fails because of improper import of isDayjs

simply create index.html, with below code and run it

this will fail,

<script type="module">
  import { isDayjs } from "https://cdn.jsdelivr.net/npm/dayjs@1.10.4/+esm";

  console.log(isDayjs);

</script>

this will pass,

<script type="module">
  import Dayjs from "https://cdn.jsdelivr.net/npm/dayjs@1.10.4/+esm";

  console.log(Dayjs.isDayjs);

</script>

related ticket in dayjs, iamkun/dayjs#1306

πŸ›  Implementation details

Provide a description of the implementation

  • fix import usage

🎨 UI Changes

Add relevant screenshots

@arnautov-anton
Copy link
Contributor

Hey, @goldenratio, the change seems reasonable enough to me so I think we can merge and release afterwards. Thank you for your contribution! πŸ™‚

@arnautov-anton arnautov-anton merged commit 73f8767 into GetStream:master Jan 30, 2026
arnautov-anton added a commit that referenced this pull request Jan 30, 2026
### 🎯 Goal

_Describe why we are making this change_

recently we moved our stack to ESM (micro frontends, uses import maps).
Noticed we are getting below error in the micro-frontend that uses
`stream-chat-react`,

```
Failed to load module mfe-chat SyntaxError: The requested module 'dayjs' does not provide an export named 'isDayjs' (at index.umd-ce148d01.js:18:14)
```
on further investigation, found:

- `isDayjs` is actually not exported in `dayjs` esm build. It needs to
be accessed to through `dayjs` instance.
- We are using importmap (esm), to satisfy `dayjs` dependency, this
fails because of improper import of `isDayjs`

simply create `index.html`, with below code and run it

**this will fail,**
```html
<script type="module">
  import { isDayjs } from "https://cdn.jsdelivr.net/npm/dayjs@1.10.4/+esm";

  console.log(isDayjs);

</script>
```

**this will pass,**
```html
<script type="module">
  import Dayjs from "https://cdn.jsdelivr.net/npm/dayjs@1.10.4/+esm";

  console.log(Dayjs.isDayjs);

</script>
```

related ticket in dayjs, iamkun/dayjs#1306

### πŸ›  Implementation details

_Provide a description of the implementation_

- fix import usage

### 🎨 UI Changes

_Add relevant screenshots_

Co-authored-by: Anton Arnautov <43254280+arnautov-anton@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Jan 30, 2026
## [13.13.6](v13.13.5...v13.13.6) (2026-01-30)

### Bug Fixes

* isDayjs import usage for ESM ([#2924](#2924)) ([009a732](009a732))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments