Recently, I've been incorporating Jasmine unit tests into my Angular 2 project and made updates to some NPM packages. As a result, I've encountered two distinct errors that seem to be interconnected, so I thought it best to address both in one question.
First and foremost, I've encountered a build error that is hindering the project compilation process. After running >ng build in Angular-CLI, the chunks seem to be generated correctly. However, upon proceeding, I am met with a series of errors indicating issues with references to global document or window variables. The specific errors I'm seeing are:
https://i.sstatic.net/zMkjw.png
Or the message "Cannot find name 'window'." Strangely, these references do not show up as red lines in Visual Studio, and I've historically used them without any problems, leading me to suspect that this may be related to the recent update of Typescript.
Moreover, within my new test files, all Jasmine references appear as unknown names, flagged with red lines.
https://i.sstatic.net/UudF5.png
Coincidentally, the tests are running fine without any complaints. However, Visual Studio is littering my test files with markup. Despite reviewing various Stack Overflow questions on the topic, none of the suggested solutions have remedied my issue.
Below is a glimpse of my tsconfig.json configuration:
https://i.sstatic.net/ywrXA.png
I have verified that the TypeRoots path is accurate and that the necessary NPM modules have been installed.
Here is a snippet from my package.json: