This may happen because you have not added the identifier of the path where this file is located to the include in tsconfig.json. I also encountered this problem, and finally found out about it through a very accidental prompt. And there is no need for the require import method.