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

TypeScript error: Property does not exist on type 'ChainedCommands' #3785

Closed
1 of 2 tasks
songhn233 opened this issue Feb 23, 2023 · 7 comments
Closed
1 of 2 tasks

TypeScript error: Property does not exist on type 'ChainedCommands' #3785

songhn233 opened this issue Feb 23, 2023 · 7 comments
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@songhn233
Copy link

What’s the bug you are facing?

Same as #2867, But because this problem seems to be repeated, I launched a new issue.

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

Chrome Latest

How can we reproduce the bug on our side?

Although I have pin Typescipt version:

image

But also throw type errors:

image

Can you provide a CodeSandbox?

No response

What did you expect to happen?

Typescript Correctly

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. 💖
@songhn233 songhn233 added the Type: Bug The issue or pullrequest is related to a bug label Feb 23, 2023
@bdbch
Copy link
Contributor

bdbch commented Feb 24, 2023

Hey @songhn233

Do you have all required extensions installed? @tiptap/starter-kit should provide those typings to the core command types.

Does this also happen for commands provided by other extensions?

@songhn233
Copy link
Author

Hey @songhn233

Do you have all required extensions installed? @tiptap/starter-kit should provide those typings to the core command types.

Does this also happen for commands provided by other extensions?

@bdbch My package.json:

    "@tiptap/pm": "2.0.0-beta.218",
    "@tiptap/react": "2.0.0-beta.218",
    "@tiptap/extension-placeholder": "2.0.0-beta.218",
    "@tiptap/starter-kit": "2.0.0-beta.218",

And starter-kit will throw error:

image

Property 'toggleBold' does not exist on type 'ChainedCommands'. Did you mean 'toggleNode'?

@bdbch
Copy link
Contributor

bdbch commented Feb 24, 2023

What kind of Setup are you using / what's your tsconfig looking like? I'm quite confused as I didn't see this issue yet.

@songhn233
Copy link
Author

songhn233 commented Feb 25, 2023

What kind of Setup are you using / what's your tsconfig looking like? I'm quite confused as I didn't see this issue yet.

@bdbch Start with vite + react

My client tsconfig:

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "allowJs": false,
    "allowSyntheticDefaultImports": true,
    "baseUrl": ".",
    "esModuleInterop": false,
    "isolatedModules": true,
    "jsx": "react",
    "lib": ["DOM", "DOM.Iterable", "ESNext"],
    "module": "ESNext",
    "noEmit": true,
    "paths": {
      "~/*": ["src/*"]
    },
    "resolveJsonModule": true,
    "skipLibCheck": false,
    "target": "ESNext",
    "types": ["vite/client"]
  }
}

extended tsconfig:

{
  "compilerOptions": {
    "allowJs": true,
    "declaration": true,
    "emitDecoratorMetadata": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "forceConsistentCasingInFileNames": true,
    "incremental": true,
    "keyofStringsOnly": true,
    "module": "ES2020",
    "moduleResolution": "node",
    "removeComments": true,
    "resolveJsonModule": true,
    "sourceMap": true,
    "skipLibCheck": true,
    "strict": true,
    "target": "ES2019"
  },
  "exclude": ["**/node_modules/*", "**/dist/*", "scripts/*"]
}

Maybe my vscode version will also have an impact? For 1.75.0-insider.

@songhn233
Copy link
Author

What kind of Setup are you using / what's your tsconfig looking like? I'm quite confused as I didn't see this issue yet.

@bdbch Hey, I have resolved this issue. The reason was the impact of blocknote. Specifically, blocknote was using beta.217 underhood while I installed tiptap with beta.218. There might be another reason related to pnpm. After removing blocknote dependencies and using the pnpm prune command, I reloaded typescript project, and the type issue was resolved.

@fshafiee
Copy link

Using @tiptap/v2.0.1 with an ESM Typescript project, basically all type definitions are broken due to missing extensions in import statements. Had to patch all packages (using yarn patch) and fix import statements by adding .js to get rid of this problem. I believe this needs fixing on @tiptap side since the package type has been changed to module in all of @tiptap packages and ESM standard requires the extensions to be specified.

@svenadlung
Copy link
Contributor

@fshafiee the issue you raised is related to this, right?

Since the initial problem seems to be solved, I would close here and continue the other topic in the other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

4 participants