How to use Polotno Design editor with Next.js framework?
Take into this GitHub repository for a demo: https://github.com/polotno-project/polotno-next
1. Install dependencies:
Create a file
components/editor.js
. Do not place it insidepages
orapp
folders to avoid server-side rendering.
Import editor in a client component with dynamic loading:
Next.js version 15
Add the following into package.json
and reinstall dependencies.
For pnpm
Config (outdated)
Note: these configs were required in previous versions of nextjs
. We will keep them in docs temporary.
If you use app
folder make sure to put this into next.config.js
If you use turbopack you may need to create an empty file called empty.js
and use this config to disable canvas module loading: