Skip to content

Upgrading Plate from 49 -> 52 tons of issues even after depset and manual installs. #4772

@thedonmon

Description

@thedonmon

Description

I'm trying to understand the best way to upgrade from 49 to 52 to take advantage of the ai-sdk upgrade to v5. I tried several ways for updates but im running into so many type issues on "non existent" methods from the exports I cant seem to figure out the best way to do this. I ran pnpm dlx depset@latest @platejs 52 && npx depset@latest platejs 52 to try and pin everything after installing the latest ai-editor

I had installed the ai-kit using shadcn registries and so after reading through some similar issues here, I used the troubleshoot guide to make sure everything is on the correct version. What are the best ways to ensure a clean install and update of plate components? For example im seeing this:

pnpm build:

./src/components/ui/export-toolbar-button.tsx
Attempted import error: 'serializeHtml' is not exported from 'platejs' (imported as 'serializeHtml').

./src/components/ui/import-toolbar-button.tsx
Attempted import error: 'getEditorDOMFromHtmlString' is not exported from 'platejs' (imported as 'getEditorDOMFromHtmlString').

./src/components/editor/use-chat.ts:116:52
Type error: Argument of type 'unknown' is not assignable to parameter of type 'AIToolName'.

  114 |     onData(data) {
  115 |       if (data.type === 'data-toolName') {
> 116 |         editor.setOption(AIChatPlugin, 'toolName', data.data);
      |                                                    ^
  117 |       }
  118 |
  119 |       if (data.type === 'data-comment' && data.data) {

Using NextJS 15.5.7

pnpm why platejs:

@platejs/ai 52.0.6
├─┬ @platejs/markdown 52.0.4
│ └── platejs 52.0.8 peer
├─┬ @platejs/selection 52.0.1
│ └── platejs 52.0.8 peer
├─┬ @platejs/suggestion 52.0.1
│ ├─┬ @platejs/diff 52.0.1
│ │ └── platejs 52.0.8 peer
│ └── platejs 52.0.8 peer
└── platejs 52.0.8 peer
@platejs/autoformat 52.0.1
└── platejs 52.0.8 peer
@platejs/basic-nodes 52.0.1
└── platejs 52.0.8 peer
@platejs/basic-styles 52.0.1
└── platejs 52.0.8 peer
@platejs/callout 52.0.1
└── platejs 52.0.8 peer
@platejs/caption 52.0.1
└── platejs 52.0.8 peer

pnpm why @platejs/core :

@platejs/ai 52.0.6
├─┬ @platejs/markdown 52.0.4
│ └─┬ platejs 52.0.8 peer
│   ├── @platejs/core 52.0.8
│   └─┬ @platejs/utils 52.0.8
│     └── @platejs/core 52.0.8
├─┬ @platejs/selection 52.0.1
│ └─┬ platejs 52.0.8 peer
│   ├── @platejs/core 52.0.8
│   └─┬ @platejs/utils 52.0.8
│     └── @platejs/core 52.0.8
├─┬ @platejs/suggestion 52.0.1
│ ├─┬ @platejs/diff 52.0.1
│ │ └─┬ platejs 52.0.8 peer
│ │   ├── @platejs/core 52.0.8
│ │   └─┬ @platejs/utils 52.0.8
│ │     └── @platejs/core 52.0.8
│ └─┬ platejs 52.0.8 peer
│   ├── @platejs/core 52.0.8
│   └─┬ @platejs/utils 52.0.8
│     └── @platejs/core 52.0.8
└─┬ platejs 52.0.8 peer
  ├── @platejs/core 52.0.8
  └─┬ @platejs/utils 52.0.8
    └── @platejs/core 52.0.8

Any help or guidance is appreciated here! Maybe I need to update my nextjs version to latest?

Reproduction URL

No response

Reproduction steps

1. npx shadcn@latest add https://platejs.org/r/ai-kit    
2. pnpm dlx depset@latest @platejs 52 && npx depset@latest platejs 52
3. pnpm build
4. All the linting and type errors (some packages like @ai-sdk/gateway needed to be installed manually).

Plate version

52

Slate React version

{}

Screenshots

Logs

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions