Cannot convert 'const glm::tvec3 ' to 'float'

Hello, I’m trying to modify the value of a vector by reference, and I’m having this error:

type_vec3.inl:80:5: error: cannot convert 'const glm::tvec3<float, glm::precision::highp>' to 'float' without a conversion operator

This is my method:

void PinholeCamera::getPrimaryRay(float x, float y, int width, int height, glm::vec3& P, glm::vec3& w) const {
    const float side = -2.0f * tan(verticalFieldOfView / 2.0f);

    //the error comes from this line
    P = glm::vec3( z_near * (x / width - 0.5f) * side * width / height,
               z_near * -(y / height - 0.5f) * side,
    glm::vec3 dir = P - centerOfProjection;
    w = glm::normalize(dir);

Do you have an idea about what am I doing wrong?

My bad, I was passing z_near as a glm::vec3 instead as a float