0

I am currently getting a TypeScript error shown in the thread below despite having the most recent TypeScript and react types versions on my project (TypeScript 5.2.2 and @types/react 18.2.21:

Next 13 — client and async server component combined: 'Promise<Element>' is not a valid JSX element

I then saw the below thread so I tried using a TypeScript workspace version since my VS code version is on 4.5.4

async server component throwing error with new typescript version

I am now getting this error. I have checked to make sure the file is in my project and reloaded my vscode window:

/Users/abuhelos/Desktop/project/node_modules/typescript/lib/tsserver.js doesn't point to a valid tsserver install. Falling back to bundled TypeScript version.

I also tried making a .vscode file for my project:

How to use TypeScript version defined in settings.json by default in VSCode?

Here is my settings.json file:

{
    "workbench.editor.closeOnFileDelete": true,
    "typescript.enablePromptUseWorkspaceTsdk": true,
    "typescript.tsdk": "./node_modules/typescript/lib"
}
2
  • .vscode is a folder. Please post your full settings.json Commented Sep 18, 2023 at 19:44
  • Just added settings.json. Will try removing node_modules/npm install in a bit will let you know how that works out. Commented Sep 18, 2023 at 22:03

1 Answer 1

0

Looks like you are mixing package mangers (like yarn and pnpm).

Remove the node_modules and try to reinstall everything using only npm install and then try again.

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

1 Comment

This did not work. I deleted my node_modules and yarn.lock file, used npm install, and then refreshed my vscode window, getting the same error.

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.