-
Notifications
You must be signed in to change notification settings - Fork 781
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
Plate editor breaks when rendering in next.js app router api route #4032
Comments
You'll need to use |
@zbeyens I get the same issue when changing to
note the minimal repro setup of components is just a subset of the plate-template for nextjs |
To be clear, the error isn't occuring within any function call but rather from the imports when modules are initialised. top level |
This is weird the RSC is running well since it does not support such import as well |
Rule of thumb: you can't import from any packages ending with |
Interesting. How do I reference correctly all the plugins for my various components? Eg. Or do I not even need the plugins and it's more about the component mapping and there I need to maintain a copy of all the right component keys rather than referencing the plugin directly (eg. |
Update: Using the base plugins (eg Thanks for the help. Will just need to go through and not use |
Description
Importing and using
createPlateEditor
inside a next.js server api route, an error will occur.Related but an aside, when using next.js with turbo (what I had previously) an alternative error occurs:
This might not be a pure bug but rather a limitation of using plate in server side next.js that could have a workaround or could just not be feasible. Either way, given popularity of next.js it might be worth adding to the server-side rendering docs
Reproduction URL
https://codesandbox.io/p/devbox/rw7lhk?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522cm6aq97sb00063b6k19g8y6qy%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522cm6aq97sb00023b6kgdamu4lx%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522cm6aq97sb00043b6k1u93ggwn%2522%257D%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522cm6aq97sb00053b6km6ao42el%2522%257D%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522cm6aq97sb00023b6kgdamu4lx%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cm6aq97sb00013b6kv938v7se%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%257D%255D%252C%2522id%2522%253A%2522cm6aq97sb00023b6kgdamu4lx%2522%252C%2522activeTabId%2522%253A%2522cm6aq97sb00013b6kv938v7se%2522%257D%252C%2522cm6aq97sb00053b6km6ao42el%2522%253A%257B%2522id%2522%253A%2522cm6aq97sb00053b6km6ao42el%2522%252C%2522activeTabId%2522%253A%2522cm6aqff4z00463b6ki3xvgki5%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522cm6aqff4z00463b6ki3xvgki5%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%255D%257D%252C%2522cm6aq97sb00043b6k1u93ggwn%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cm6aq97sb00033b6kq7424iu5%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522cm6aq97sb00043b6k1u93ggwn%2522%252C%2522activeTabId%2522%253A%2522cm6aq97sb00033b6kq7424iu5%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D
Reproduction steps
Plate version
41.0.5
Slate React version
^0.112.0
Screenshots
Logs
Browsers
No response
The text was updated successfully, but these errors were encountered: