const navItem = Object.values(Path).filter(item => pathname.includes(item))
Path is an enum with string values.
I was getting error on the item saying Arg of type unknown is not assignable to param of type 'string'.
This compilation error did not exist before. I did not change anything regarding the code. It seems to have popped up after I changed to an old branch and changed back.
I then wrote some code (to check some types const x = typeof Object.values(Path) sorta useless code btw) and then commented it out, effectively changing nothing, and somehow it worked again.
I tried restarting the ts server earlier nothing happened. It seems like something to do with enums, the node server thats running my react app and changing branches that may have added untracked files or changed file casing that also isn't tracked...
(i.e I have run into compilation error after switching to and from an old branch where I changed casing of a file, because git doesn't track those changes for some reason. - fixed by just changing the file back to my wanted casing)
Note: This error was on the dev server (as well as visualised on chrome - showing compilation error)
Note2: I'm using VSCode - there was no red squiggly line under the item but in the chrome browser it does show.
Any feedback/ideas as to the cause of this error would be welcome!