motss / app-datepicker

Datepicker element built with Google's lit and Material Design 2021
https://npm.im/app-datepicker
MIT License
180 stars 51 forks source link

Uncaught (in promise) TypeError: Cannot read property 'addEventListener' of null at new Tracker (tracker.ts:91) at HTMLElement.updated (app-datepicker.ts:671) #157

Closed CartmanErik closed 4 years ago

CartmanErik commented 5 years ago

Description

Have a problem with app-datepicker. Calendar doesn't show up. Instead of it I have some class in calendar window as text. Part of this class: ... { if (!(part instanceof NodePart)) { throw new Error('cache can only be used in text bindings'); } let templateCache = templateCaches.get(part); if (templateCache ...

In console I have errors: Uncaught (in promise) TypeError: Cannot read property 'addEventListener' of null at new Tracker (tracker.ts:91) at HTMLElement.updated (app-datepicker.ts:671) at HTMLElement.performUpdate (updating-element.ts:215) at HTMLElement._enqueueUpdate (updating-element.ts:717)

Expected outcome

Calendar should show up

Actual outcome

Calendar doesn't show up. Instead of it I have some class in calendar window as text. Part of this class: ... { if (!(part instanceof NodePart)) { throw new Error('cache can only be used in text bindings'); } let templateCache = templateCaches.get(part); if (templateCache ...

In console I have errors: Uncaught (in promise) TypeError: Cannot read property 'addEventListener' of null at new Tracker (tracker.ts:91) at HTMLElement.updated (app-datepicker.ts:671) at HTMLElement.performUpdate (updating-element.ts:215) at HTMLElement._enqueueUpdate (updating-element.ts:717)

Live Demo

Steps to reproduce

Browsers Affected

motss commented 5 years ago

Do you have a reduced test case for this problem? What's the version of lit-element you are using?

CartmanErik commented 5 years ago
"lit-element": "^2.2.0",
"lit-html": "^1.1.0"

To be honest I don't know how to reproduce test case. It works for some people but doesn't work for other. I tried to use previous version of datepicker and it works as it should. But v4 doesn't work for me.

motss commented 5 years ago

Thank you for the response. I'll keep this opened for a while and see if that happens again before closing this.

kaseyhinton commented 5 years ago

I was getting this problem too for a minute. I was using the newest chrome, lit, and app-datepicker. I downgraded lit element and locked it in to 2.1.0 and then it started working with 4.0.0-rc.30. Once I reinstalled node modules and restarted my node server this error went away and the datepicker started functioning as normal.

motss commented 5 years ago

Sorry for the long wait. I managed to have a time to dive into the issue. This should have been resolved by this e3cc4494917cfc2f0e30d0ee5792b0b2832638ed commit. Please give it a try and see if that resolves on your side.

motss commented 4 years ago

Closing this