Cant add isSameOrAfter plugin: Cannot read property '$i' of undefined
See original GitHub issueDescribe the bug
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.4/dayjs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.4/plugin/isSameOrAfter.min.js"></script>
<script>
dayjs.extend(window.isSameOrAfter);
</script>
Uncaught TypeError: Cannot read property '$i' of undefined
at Function.v.extend (dayjs.min.js:1)
at register:724
Expected behavior no error
Information
- Day.js Version 1.10.4
- OS: [e.g. iOS]
- Browser chrome
- Time zone: [Asia Singapore]
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Cant add isSameOrAfter plugin: Cannot read property '$i' of undefined
Cant add isSameOrAfter plugin : Cannot read property '$i' of undefined.
Read more >Issuehunt
Cant add isSameOrAfter plugin: Cannot read property '$i' of undefined #1494 · Describe the bug · Expected behavior · Information.
Read more >jQuery plugin returning "Cannot read property of undefined"
I can't figure out why this isn't working. No matter how i write the jQuery code, it doesn't work. menuitems[i].action() just does NOT...
Read more >IsSameOrAfter
IsSameOrAfter adds `.isSameOrAfter()` API to return a `boolean` indicating if a date is the same or after another date.
Read more >dayjs - npm
2KB immutable date time library alternative to Moment.js with the same modern API . Latest version: 1.11.7, last published: 22 days ago.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

this worked for me:
@chrisvidal I also had the same issue and found a different way of extending; Add dayjs_plugin_ before the plugin name you require.