Reg:Socket in Ionic3

I am having an issue with the socket connection with my ionic3 application. I am using socket for implementing chat. Please find the below work flow.

  1. I have configured the in my dashboard moudule (Not on app.module.ts) because I have to pass user token while connection which is obtained only after login. I have added screenshot below. Here I am getting success socket connection with the server.

  2. When I import the socket in my chat page or in any other page, I am getting the below error.

Could anyone please help me how to solve this type of error?

@anna_liebt, @Sujan12 could you please help me?