white-sugar-85462
08/07/2025, 5:43 AMtall-airline-16756
08/07/2025, 5:46 AMtall-airline-16756
08/07/2025, 5:46 AMTypeError: Cannot read property ‘toLowerCase’ of undefined typically occurs when an undefined value is being passed where a valid Track.Source is expected. Here are some steps to resolve this:
• Verify Track Sources: Ensure that all values passed to useTracks are valid Track.Source values. For example, check that Track.Source.Microphone and Track.Source.ScreenShare are correctly imported and defined.
• Filter Undefined Sources: Add a filter to remove any undefined sources before passing them to `useTracks`:
const validSources = [Track.Source.Microphone, Track.Source.ScreenShare].filter(source => source !== undefined);
const tracks = useTracks(validSources, { onlySubscribed: true });
• Check Participant Context: If the error persists, ensure that the participant context is valid and properly initialized when using useTracks.
Let me know if you need further assistance or additional debugging steps!