I had this problem when I had the expected type in a file named alma.d.ts in a folder that also contained a regular alma.ts file. When I renamed the alma.ts file the error went away.