Okay, so the line number error reported by the build process was from the bundler, not from Typescript, which is why it had nothing to do with the code I was looking at.
When I say that the appeal of LLMs for programming comes from modern languages and tools being shit: this is why.