Next.js Discord

Discord Forum

Help: ServerProviders cannot be used as a JSX component.

Answered
Arthur Ropke posted this in #help-forum
Open in Discord
Avatar
Yesterday, I cleaned my project by deleting the node_modules folder and the package-lock.json file. After that, I started experiencing a lot of type-related problems.
Another issue is that npm has become very slow. However, when we restore the old package-lock.json file, the problems are resolved.
Does anyone know what might be causing these issues? They all started yesterday.

P.S: I tested in other projects, and I had the same problem.

Type error: 'ServerProviders' cannot be used as a JSX component.


my versions:

  "dependencies": {
   "react": "^18",
   "react-dom": "^18",
   "next": "14.2.8",
},
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "eslint": "^8",
    "eslint-config-next": "14.2.8",
    "typescript": "^5.5.4"
  }
Answered by Arthur Ropke
Solved this problem with those versions of react:

  "dependencies": {
    "react": "18.3.1",
    "react-dom": "18.3.1",
  },
  "devDependencies": {
    "@types/react": "18.3.12",
    "@types/react-dom": "18.3.1",
  }
View full answer

1 Reply

Avatar
Solved this problem with those versions of react:

  "dependencies": {
    "react": "18.3.1",
    "react-dom": "18.3.1",
  },
  "devDependencies": {
    "@types/react": "18.3.12",
    "@types/react-dom": "18.3.1",
  }
Answer