Search code examples
typescriptvisual-studio-codenouislider

VS Code Typescript Build Error on modified @types/nouislider .ts file


I had to rebuild my laptop and am trying to get my company's typescript project to build.

I used npm i --save-dev @types/nouislider and then I have to edit the ts file to add a missing property. I added target property to the noUiSlider interface.

enter image description here

When I try to build, I get this error, but you can see from the tooltip, that VS Code 'knows' about the target property.

enter image description here

This code is working on my desktop and I can't see a difference in VS Code versions or settings. Not really knowing where to look to solve this. Anyone have any ideas?


Solution

  • Seems VS had some sort of build cache or something. I renamed the property in the modified index.d.ts file to target2. Then recompiled and obviously .target was incorrect and VS Code suggested target2. I changed to target2 and built successfully. I then just changed the index.d.ts back to target and repeated the process successfully.