chilly-laptop-56953
03/07/2024, 6:00 PMRudderSDK: Warn: identify : Unsupported argument type passed to identify
I have to admit to being a bit baffled as prior to extracting this particular function to the hook, it worked fine:
const identifyUser = async (user: IdentifyProps) => {
const traits = {
email: user.email,
id: user.id,
uid: user?.uid,
sid: user?.sid,
};
const options = {};
await rudderClient.identify(user.id, traits, options);
console.log('IDENTIFY USER',JSON.stringify({ traits, options }, null, 2));
};
Near as I can tell, when I log the data out, I get nothing unusual and my other screen and track events work fine. If any of you could shed a bit of light on what I'm doing wrong here that would be fab. Thanks!millions-activity-52391
03/07/2024, 6:00 PMhundreds-lifeguard-65770
03/07/2024, 6:19 PMchilly-laptop-56953
03/07/2024, 6:21 PMhundreds-lifeguard-65770
03/07/2024, 6:39 PMhundreds-lifeguard-65770
03/07/2024, 6:39 PMchilly-laptop-56953
03/07/2024, 6:46 PMArgument of type 'string' is not assignable to parameter of type 'Record<string, unknown>'.ts(2345)
I'm still a bit fresh off the boat on the TS front, but this gives me the impression it is expecting a 3rd parameter - despite not being explicit about it. I might have to go digging round the source to see if I can figure out what's going onchilly-laptop-56953
03/07/2024, 6:49 PMdeclare function identify(userId: string, traits: Record<string, unknown>, options: Record<string, unknown>): Promise<void>;
declare function identify(traits: Record<string, unknown>, options: Record<string, unknown>): Promise<void>;
Strange.calm-yak-10773
03/08/2024, 1:17 AMuser.id field is of integer type. Therefore you’re getting this error. Can you please make sure it is of type string or better cast it to string?chilly-laptop-56953
03/08/2024, 1:54 AM