0

I am developing a web application with Angular 16 in Webstorm. The web application is currently pre-release and only has a small portion of minimum functionality completed. I was editing with ng serve running testing changes as I made them when the compiler stopped compiling the app emitting the following error:

Error: node_modules/@angular/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts:37:247 - error TS2694: Namespace 'ts' has no exported member 'ResolutionMode'.

37     resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[] | readonly ts.FileReference[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, contain
ingFileMode?: ts.ResolutionMode) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;

I have tried:

  • removing all of my changes related to what I was working on (dismissing a modal dialog) including the service calls to my API
  • updated the installed version of TypeScript,
  • updated all Angular packages to ensure that they are all of the same version with one another.
  • deleted node_modules and ran npm install again just to be sure.
  • cloned the repo to a new machine and attempted to build it there all with the same result ensuring this was not some weird environment fluke.

Github repo exhibiting the problem.

Has anyone ever had an instance where Angular just straight up does not recognize a base TypeScript member? I have navigated to typescript.d.ts and ResolutionMode is in fact noted in there.

1 Answer 1

0

OK, turns out updating typescript was what fixed it. I don't know what I did before, when I THOUGHT I was updating typescript, nor why it took weeks for compiler-cli to decide to error out.

It appears that I WAS running Typescript 4.9.4. Now, update.angular.io SAYS that Typescript versions above 4.9.3 are required, but this appears to be not entirely correct. Regardless, updating Typescript fixed the problem.

Sign up to request clarification or add additional context in comments.

2 Comments

To what version did you update typescript? I running into the same issue, but a fresh install does not seem to work just like you mentioned in your question. Are you using 4.9.4 still? How did you update it finally?
@MZeinstra Version 5.2.2 which was the latest stable version at the time. I did it through NPM as it was noted in the package.json. I also ensured that my IDE, in this case Webstorm, was pointed at the same version because it did seem to have some problem that I can't recall the exact nature of until it was using the same version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.