Is there a rigorous definition of a line? In the sources I can find, line is considered a primitive concept (a one without definition). There is something, however, in such an intuitive definition that doesn't sit well with me.
Were there any attempts to rigorously define line?
And if there weren't, why? What makes line a concept which shouldn't be defined rigorously?

Euclid's Approach
I assume the context here is classical geometry in the style of Euclid. At the very beginning of Euclid's Elements, he defines:

A point is that which has no part.
A line is breadthless length.

That is, a point is that thing that has no extent in any direction, and a line has length but no width. These definitions are suitable for seeing what kinds of things he's talking about, but they're not very precise. A more modern approach might be to take one of the two following perspectives.
Axiomatic Approach
This is the approach your sources probably use. With an axiomatic approach, the basic concepts like points and lines don't have definitions at all. Their basic properties and relationships with each other are then given as axioms, and we draw conclusions from those axioms alone. The advantage is that we can then apply those conclusions to anything satisfying the axioms.
Algebraic Approach
The other modern approach is to look at the space we're working with (say, the plane), and assign each point on it coordinates of the form $(x,y)$ (e.g., "$(2,4)$", or "$(1.4,-9.6)$"). A line would then be defined as a set of points satisfying an equation of the form $ax + by = c$, for some specific choice of $a$, $b$, and $c$. The advantage of this approach is that numbers and equations are very expressive, and they allow us do describe much more sophisticated concepts and techniques.
