Search code examples
node.jsreactjstypescriptnext.js

Why am I getting a "DeprecationWarning: 'originalKeywordKind' deprecated" error when attempting to compile my project?


After compiling my project, I get the error pasted below, what does this mean and how can I fix it?

- info Linting and checking validity of types
DeprecationWarning: 'originalKeywordKind' has been deprecated since v5.0.0 and will no longer be usable after v5.2.0. Use 'identifierToKeywordKind(identifier)' instead.

while npm run build

I'm using nextjs 13.4 and my dependencies are as follows:

"dependencies": {
    "@prisma/client": "^5.0.0",
    "@types/bcryptjs": "^2.4.2",
    "@types/node": "^20.4.5",
    "@types/react": "^18.2.16",
    "@types/react-dom": "^18.2.7",
    "axios": "^1.4.0",
    "bcryptjs": "^2.4.3",
    "eslint": "^8.45.0",
    "eslint-config-next": "^13.4.12",
    "next": "^13.4.12",
    "next-auth": "^4.22.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hook-form": "^7.45.2",
    "react-uuid": "^2.0.0",
    "typescript": "^5.1.6"
},
"devDependencies": {
    "@vercel/analytics": "^1.0.1",
    "autoprefixer": "^10.4.14",
    "postcss": "^8.4.27",
    "prettier-plugin-tailwindcss": "^0.4.1",
    "prisma": "^5.0.0",
    "tailwindcss": "^3.3.3"
}

Solution

  • This refers to a change in Typescript: https://github.com/microsoft/TypeScript/blob/main/src/deprecatedCompat/5.0/identifierProperties.ts#L28

    And something, probably one of your dependencies, haven't adapted to that change just yet, but it's only a deprecation warning, so no worries at the moment. 🙂