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

ChangedElements not exported, caused tsc fail #4134

Open
StephenPCG opened this issue Mar 3, 2025 · 0 comments
Open

ChangedElements not exported, caused tsc fail #4134

StephenPCG opened this issue Mar 3, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@StephenPCG
Copy link

Description

The following code (copied from potion):

export const blockSelectionPlugin = BlockSelectionPlugin.configure(
   // internal code is irrelevant
);

tsc complains ChangedElements is not exported:

Image

My local env: a monorepo, an web app and a potion-editor lib (code copied from potion), in potion-editor lib, tsconfig.json is like:

{
  "extends": "base.json",
  "compilerOptions": {
    "baseUrl": "./",
    "declarationDir": "dist/",
    "outDir": "dist/",
    "paths": {},
    "declaration": true,
    "declarationMap": true,
    "noEmit": false
  },
}

in my monorepo, all lib packages are compiled on their own (just tsc transpile, no bundlers), tsc needs to export type declarations to make code editor happy. Since tsc needs to export declaration, and BlockSelectionPlugin referenced an internal type ChangedElements, caused tsc fail. This error can not be ignored by @ts-ignore, because it is not a type check error, tsc can not generate type declarations.

To reproduce this problem, the key is set declaration to true in tsconfig.json , if declaration is set to false, tsc won't fail.

Reproduction URL

No response

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Plate version

45.0.9

Slate React version

0

Screenshots

Logs

Browsers

No response

@StephenPCG StephenPCG added the bug Something isn't working label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant