If you are using VSCode and you have the module setting in typescript configuration set to ‘es2020’, ‘es2022’, ‘esnext’, ‘system’, ‘node12’, or ‘nodenext’.
Then you might want to try simply restarting your typescript server. The quickest way would by hitting (ctrl+shift+p) and selecting restart typescript server. Picture attached.