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
What I would really like is something like React's error boundaries but I have no clue how that could work. So if it is easy to implement just catching on init, I think that would already make a big difference since when components fail it is often at that point.
Ideally we would clearly indicate the name of the component that failed and that it happened on initialization.
The text was updated successfully, but these errors were encountered:
// we don't want an error in one component to stop creating all other components
try{
constinstance=newBlockConstructor(element);
setComponentInstance(displayName,{ instance, element });
newInstances.push(instance);
}catch(error){
// eslint-disable-next-line no-console
console.error(error);
Would be fairly easy to add a more descriptive error message there.
Providing a fallback can be registered on the component itself statically (since it cannot be constructed), although we have to find a uniform way to render/replace the HTML, and how/if we make that interactive.
Another option could be to configure it globally, and/or when calling initComponents. Globally is tricky though, since there is no scope/context, it's just a function to be called. We might need to introduce a global muban namespace (which is already hacked in to store the created component instances).
What I would really like is something like React's error boundaries but I have no clue how that could work. So if it is easy to implement just catching on init, I think that would already make a big difference since when components fail it is often at that point.
Ideally we would clearly indicate the name of the component that failed and that it happened on initialization.
The text was updated successfully, but these errors were encountered: