The difference is subtle. According to ES6 grammar, the ModuleSpecifier ("./components/Home" in your example) has to be a StringLiteral at compile time. This is so its structure can be statically analyzed; for static checking, optimization, etc...
In other words, the "type" information of ModuleSpecifier cannot depend on runtime information; which is what is happening (and the reason it fails) in the second example where you are using only an IdentifierName (stringVar).