solid-router icon indicating copy to clipboard operation
solid-router copied to clipboard

Rare error in solid-app-router that I am seeing in Sentry

Open fireph opened this issue 3 years ago • 1 comments

There is this relatively rare error I am seeing pop up in Sentry and was wondering if you could take a look:

TypeError N.composedPath is not a function

../../node_modules/solid-app-router/dist/routing.js in D at line 286:23

                evt.metaKey ||
                evt.altKey ||
                evt.ctrlKey ||
                evt.shiftKey)
                return;
            const a = evt
                .composedPath()
                .find(el => el instanceof Node && el.nodeName.toUpperCase() === "A");
            if (!a)
                return;
            const isSvg = a instanceof SVGAElement;

fireph avatar Apr 13 '22 16:04 fireph

Hmm, composedPath is a widely supported property of the Event interface so this feels like Sentry is interfering. They replace addEventListener on the various event target prototypes with their own. Since you indicated it doesn't always happen, I wonder if there is a race condition between the router and Sentry and somehow the router's event handler gets the event object destined for their wrapper.

Does this come up in a development build with HMR or production-type builds?

rturnq avatar Apr 21 '22 05:04 rturnq

Closing as stale.

ryansolid avatar Nov 21 '22 20:11 ryansolid