You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function setComponentProperties which is called during initial render and during rerender uses Object.defineProperty. As configurable is false by default (see MDN) this cannot be called twice and throws the error above on rerender.
I already started creating a test case for that before fixing it but it seems that Jest has configurable true by default (vs. false with Karma and a real browser) so the test does not fail :-( Should I just fix this without a new test case?
@rothsandro oh, good to know.
If you add a comment why we do it, then that's fine.
Perhaps that we should create some karma tests for safety in the future...
Steps to reproduce
Expected behavior
The template should be updated with the new value
Actual behavior
The following error is thrown:
Cause
The function
setComponentProperties
which is called during initial render and during rerender usesObject.defineProperty
. Asconfigurable
is false by default (see MDN) this cannot be called twice and throws the error above on rerender.The function should set
configurable: true
.Demo
https://github.com/rothsandro/ng-tlib-template-rerender/blob/main/src/app/rerender-template.spec.ts
The text was updated successfully, but these errors were encountered: