Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EmojiSuggestionPluginKey has the wrong type #3206

Closed
2 tasks done
Korywon opened this issue Sep 16, 2022 · 2 comments
Closed
2 tasks done

EmojiSuggestionPluginKey has the wrong type #3206

Korywon opened this issue Sep 16, 2022 · 2 comments
Labels
Info: Stale The issue or pullrequest has not been updated in a while and might be stale Type: Bug The issue or pullrequest is related to a bug

Comments

@Korywon
Copy link

Korywon commented Sep 16, 2022

What’s the bug you are facing?

I am currently maintaining a package that has the emoji extension and compiles using tsc. However, I keep hitting this issue where it complains about the PluginKey<PluginState> being wrong for the emoji extension. My IDE complained about it when I opened up the package.

Here are the list of packages I'm using:

"devDependencies": {
  "@babel/preset-env": "^7.16.0",
  "@babel/preset-react": "^7.16.7",
  "@babel/preset-typescript": "^7.16.0",
  "@types/cors": "^2.8.10",
  "@types/jest": "^27.0.2",
  "@types/jsdom": "^16.2.13",
  "@types/lowlight": "^0.0.3",
  "@types/morgan": "^1.9.2",
  "@types/node": "16.11.6",
  "@types/showdown": "^1.9.4",
  "@types/supertest": "^2.0.11",
  "nodemon": "^2.0.7",
  "supertest": "^6.1.4",
  "ts-jest": "^27.0.4",
  "ts-node": "^10.0.0",
  "typescript": "^4.4.4"
},
"dependencies": {
  "@sentry/serverless": "^6.13.3",
  "@tiptap-pro/extension-emoji": "^2.0.0-beta.17",
  "@tiptap/core": "^2.0.0-beta.195",
  "@tiptap/extension-code-block-lowlight": "^2.0.0-beta.68",
  "@tiptap/extension-image": "^2.0.0-beta.27",
  "@tiptap/extension-link": "^2.0.0-beta.38",
  "@tiptap/extension-placeholder": "^2.0.0-beta.48",
  "@tiptap/extension-text-align": "^2.0.0-beta.29",
  "@tiptap/extension-youtube": "^2.0.0-beta.195",
  "@tiptap/react": "^2.0.0-beta.195",
  "@tiptap/starter-kit": "^2.0.0-beta.195",
  "dotenv": "^10.0.0",
  "jsdom": "^18.0.1",
  "react-dom": "^17.0.2",
  "showdown": "^2.0.2",
  "winston": "^3.3.3"
},

Here's the message I'm getting in VS Code when opening the emoji.d.ts file:

[{
	"resource": "/.../node_modules/@tiptap-pro/extension-emoji/dist/tiptap-pro/packages/extension-emoji/src/emoji.d.ts",
	"owner": "typescript",
	"code": "2707",
	"severity": 8,
	"message": "Generic type 'PluginKey<PluginState>' requires between 0 and 1 type arguments.",
	"source": "ts",
	"startLineNumber": 63,
	"startColumn": 48,
	"endLineNumber": 63,
	"endColumn": 67
}]

And here it is in action when I try compiling my package:

❯ yarn tsc  
yarn run v1.22.19
$ node_modules/.bin/tsc
/.../node_modules/@tiptap-pro/extension-emoji/dist/tiptap-pro/packages/extension-emoji/src/emoji.d.ts:63:48 - error TS2707: Generic type 'PluginKey<PluginState>' requires between 0 and 1 type arguments.

63 export declare const EmojiSuggestionPluginKey: PluginKey<any, any>;

Which browser was this experienced in? Are any special extensions installed?

N/A

How can we reproduce the bug on our side?

  1. Create a TypeScript node project
  2. Add the @tiptap-pro/editor-extensions package
  3. Use the package somewhere in your code
  4. Compile using yarn tsc
  5. Observe the compile fail because of the type

Can you provide a CodeSandbox?

No response

What did you expect to happen?

I expected to be able to compile my project with the emoji extension without any errors.

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@Korywon Korywon added the Type: Bug The issue or pullrequest is related to a bug label Sep 16, 2022
@Korywon
Copy link
Author

Korywon commented Sep 16, 2022

FYI, I also just updated all dependencies related to TipTap, but still seeing the same issue.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Dec 22, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Info: Stale The issue or pullrequest has not been updated in a while and might be stale Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

1 participant