-
DescriptionHi! I can't install plate-ui due to issue with shadcn CLI. I am converting my existing editor build with Slate.js into plate (because to the awesome table and docx plugins) and I want to use plate-ui components instead of mine. In the docs I am always redirected here. Up until the step 6, everything is fine, because my project already uses shadcn/ui. When I run the provided command I get an error saying: error: unknown option '-u'And by running with Initialize your project and install dependencies
Arguments:
components the components to add or a url to the compopnent
Options:
-y, --yes skip confirm. prommpt
-d, --defaults use default confi.
-f, --force force overwrite of existing config.
-c, --cwd the working directory...
-s, --silent mute output
--src-dir use the src dir. when creating a new project
-n, --name registry name
--pm package manager
-h, --help ...So I ignore the initializing https://platejs.org/r registry...
Something went wrong...
The component at https://platejs.org/r/styles/index.json was not found.
It may not exists at the registry. Please make sure it is a valid component. I also found that at the URL if I append {
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "plate",
"type": "registry:lib",
"description": "Install Plate package",
"dependencies": [
"platejs"
],
"devDependencies": [],
"registryDependencies": [],
"files": []
}And this is as far as I got. I have no idea how to continue. Please excuse my poor english (2nd language) and please bare in mind that the outputs are not directly copied I wrote this issue from my personal laptop. I can't access public github from my corporate laptop. Thank you! Reproduction URLNo response Reproduction steps1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See errorPlate version49.2.21 Slate React version0.118.0 ScreenshotsLogsBrowsersChrome |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
|
Hi @Asqit! I'm Dosu and I’m helping the plate team. The shadcn CLI does not support the pnpm dlx shadcn@latest add https://platejs.org/r/plate-uiIf you want specific features, use their URLs, for example: pnpm dlx shadcn@latest add https://platejs.org/r/fixed-toolbar https://platejs.org/r/mark-toolbar-buttonThe error about If the CLI fails or you want more control, you can manually install Plate packages: pnpm add platejs @platejs/basic-nodesThen import and use the components in your code. For older Plate versions, use a versioned registry URL from the Plate public registry on GitHub docs. Let me know if you need help with the next steps or specific components! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @dosu bot. By running the first command I get this: You are about to install a new style.
Existing CSS variables and components will be overwritten. Continue? ... yes
Checking registry.
updating css variables in src\index.css
instaling dependencies. but it does not fix the issue that I can't install the plate-ui components (probably because the registry is still not registered) npx shadcn@latest add blockquote-element # A block found in the "build your rich-text editor"
Something went wrong. Please check the error below for more details.
It may not exist at the registry. Please make sure it is a valid component. |
Beta Was this translation helpful? Give feedback.
-
|
The error happens because To add blockquote and other basic nodes, run: pnpm dlx shadcn@latest add https://platejs.org/r/basic-nodes-kitAfter installing, import and register the plugins and components in your editor setup, for example: import { BlockquotePlugin } from '@platejs/basic-nodes/react';
import { BlockquoteElement } from '@/components/ui/blockquote-node';
// ...in your editor config:
plugins: [
BlockquotePlugin.withComponent(BlockquoteElement),
// other plugins...
]If you want more features, you can add other kits or components using their URLs from the docs. If the CLI fails, you can always install Plate packages manually: pnpm add platejs @platejs/basic-nodesThen use the plugins and UI components directly in your code. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
+1 have the same problem |
Beta Was this translation helpful? Give feedback.
-
What website did you follow? I finally got to the solution in my case. For some reason there are multiple websites with plate.js: OG, Subdomain and Fake I guess 🤷♂️. I followed the OG website and got to the point, where I have toolbar with all the plugins I wanted. Also, I don't know if that's your case or not, but if you are creating your own plugin/elements I did so by using underlying slate's API. (I couldn't fin anything in the docs, besides the createPlatePlugin func.) |
Beta Was this translation helpful? Give feedback.
Don't use next or v36. https://platejs.org/ is the one.