5

i use rxjs with typescript but i got the next ERROR

Could not find a declaration file for module 'rxjs'.'C:/Path/to/project/node_modules/rxjs/dist/cjs/index.js'

typescript version 4.7.4 

rxjs version 7.5.6

working with vscode 1.59

i create new angular 14 app. to solve this i tried to upgrade the typescript version like i saw inw the github issue that it solved afer typescript 4.2 and above but i still have the error

how to solve the versiong problem ?

2 Answers 2

3

the error was show only on the vscode and not on the tsc in the terminal. so i understood that the problem was in the vscode typescript internal server. . it has older typescript version then rxjs 7 need.... so i upgrade th vscode version to 1.69 and it was solved

you also can change the vscode ts version manually see this answer What TypeScript version is Visual Studio Code using? How to update it?

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

Comments

3

I've experienced the same error message but it was just in IntelliJ, the project compiled and ran just fine. Error when hovering

The issue was, that IntelliJ found an older Typescript version from a different frontend.

After assigning the correct TypeScript and restarting the TypeScript Service(bottom right of the editor) the error went away.

Restart ts service

If you are using 7.5.4: just update (source: https://github.com/ReactiveX/rxjs/issues/6822)

Comments

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.