-
DescriptionBug Report: Module "@udecode/plate-alignment/react" and its corresponding type declarations not found
Error: The error appears when trying to import AlignPlugin from @udecode/plate-alignment/react. It says that the module and its type declarations are not found, despite the fact that the package is correctly installed. Package Versions: Here are the versions of the relevant packages I'm using: @types/slate: ^0.47.16 Everything has been installed normally, but this issue persists with AlignPlugin. Could this be a version compatibility issue or a missing declaration in the alignment package? Reproduction URLhttps://platejs.org/docs/alignment Reproduction stepsSteps to Reproduce:
Go to your Next.js project directory.
Install the required @udecode/plate-alignment package using:
bash
Copiar código
npm install @udecode/plate-alignment
Create a new React component in your pages folder with the following code:
typescript
Copiar código
"use client";
import { AlignPlugin } from "@udecode/plate-alignment/react";
import { createPlateEditor, ParagraphPlugin, Plate, PlateContent } from "@udecode/plate-common/react";
import { HeadingPlugin } from "@udecode/plate-heading/react";
const editor = createPlateEditor({
plugins: [
HeadingPlugin,
AlignPlugin.configure({
inject: {
targetPlugins: [ParagraphPlugin.key, HeadingPlugin.key],
},
}),
],
});
export default function PageEditor(): JSX.Element {
return (
<Plate editor={editor} onChange={(data) => console.log(data)}>
<PlateContent placeholder="Type..." />
</Plate>
);
}
Run your Next.js project using:
bash
Copiar código
npm run dev
See error in the console or editor:
Error: Module "@udecode/plate-alignment/react" and its corresponding type declarations not found (ts2307). Plate version38.0.6 Slate React version38.0.4 ScreenshotsNo response LogsNo response BrowsersNo response Funding
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
You'll need to upgrade all |
Beta Was this translation helpful? Give feedback.
-
@zbeyens same problem here, seems to be a package resolution problem. |
Beta Was this translation helpful? Give feedback.
-
I get this. Using node16, nodenext fixes it but breaks other parts of my app
|
Beta Was this translation helpful? Give feedback.
-
I'm having the same problem with PlateLeaf and Plate element. A good way that I fixed with plate-common was creating a new declarations.d.ts and directing to the node modules index.d.ts from plate. But I'm having the same problem with PlateLeaf |
Beta Was this translation helpful? Give feedback.
You'll need to upgrade all
@udecode/plate-*
to v38