Cargo-culting around issues with TS+JS build tools, module formats, etc, is something that is still too painful. But I think I got most of the errors etc solved by googling and testing out random lines of code.