For what it worth, if anyone has this problem only in VSCode, just restart VSCode and it should fix it. Sometimes, Intellisense seems to mess up with imports or types.
Related to Typescript: Argument of type 'RegExpMatchArray' is not assignable to parameter of type 'string'