SOLVED:
For future reference. The issue was that Userpilot was not finding the instance of mixpanel because mixpanel was not being added to the window (when using the npm package!). That has to do with how some bundlers work, in my case Vite. What solved it was to have the mixpanel instance added to the window object manually. This way Userpilot can access it when it wants to call MP's track() event. Another important thing when calling mixpanel.init() is to pass the name as 'mixpanel'. this may not be absolutely necessary, but just in case.