Let $V$ be a connected smooth complex projective curve of negative Euler characteristic. Can there exist a connected smooth complex algebraic curve $U$ such that there is a non-constant holomorphic map $U\to V$ but no non-constant holomorphic map from the compactification of $U$ to $V$? Note that we are not merely asking that the map $U\to V$ does not extend.


EDIT: the question considers the smooth compactification of $U$.



Non-algebraic holomorphic maps between algebraic curves
Just turning my comments into an answer:


Following the OP, let $V$ be a smooth projective connected curve with negative Euler characteristic (i.e., genus at least two) over $\mathbb{C}$. Then $V$ is hyperbolic in the sense that Kobayashi's pseudometric is a metric. In particular, by a theorem of Kwack, it is "Borel hyperbolic", i.e., for every reduced finite type scheme $S$ over $\mathbb{C}$, every holomorphic map $S^{an}\to V^{an}$ is algebraic.


This implies that the answer to the OP's question is no. Indeed, let $\varphi:U^{an}\to V^{an}$ be a non-constant holomorphic map with $U$ a smooth curve. Then there is a morphism of varieties $f:U\to V$ such that $f^{an} = \varphi$. Such a morphism extends to a morphism $\overline{U}\to V$ by the valuative criterion for properness.


