-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Describe the Bug
The @payloadcms/live-preview package is designed for use in frontend projects to build custom hooks (per https://payloadcms.com/docs/live-preview/client). However, starting around version 3.60.0 to 3.69.0, the package imports from payload/shared:
// dist/mergeData.js
import { formatAdminURL } from "payload/shared";
This breaks all non-Next.js frontend projects (SolidJS, Vue, Svelte, plain Vite+React) because payload is not installed and shouldn't be required for client-side live preview.
Link to the code that reproduces this issue
https://github.com/NicolasdRa/payload-live-preview-bug
Reproduction Steps
Affected Use Case
Building a custom useLivePreview hook for SolidJS using subscribe, unsubscribe, and ready functions - exactly as documented in https://payloadcms.com/docs/live-preview/client.
Steps to Reproduce
- Create a SolidStart/Vite project
- npm install @payloadcms/[email protected]
- Dynamic import: await import("@payloadcms/live-preview")
- Error: Failed to resolve import "payload/shared"
Workaround
Downgrade to @payloadcms/[email protected]
Which area(s) are affected?
area: live-preview
Environment Info
Binaries:
Node: 24.11.1
npm: 11.6.2
Yarn: N/A
pnpm: 10.18.3
Relevant Packages:
payload: 3.68.5
next: 15.4.10
@payloadcms/db-postgres: 3.68.5
@payloadcms/drizzle: 3.60.0
@payloadcms/email-nodemailer: 3.68.5
@payloadcms/graphql: 3.60.0
@payloadcms/live-preview: 3.60.0
@payloadcms/live-preview-react: 3.68.5
@payloadcms/next/utilities: 3.68.5
@payloadcms/payload-cloud: 3.68.5
@payloadcms/plugin-cloud-storage: 3.68.5
@payloadcms/plugin-form-builder: 3.68.5
@payloadcms/plugin-multi-tenant: 3.68.5
@payloadcms/plugin-nested-docs: 3.68.5
@payloadcms/plugin-redirects: 3.68.5
@payloadcms/plugin-search: 3.68.5
@payloadcms/plugin-seo: 3.68.5
@payloadcms/richtext-lexical: 3.68.5
@payloadcms/storage-s3: 3.68.5
@payloadcms/translations: 3.68.5
@payloadcms/ui/shared: 3.68.5
react: 19.1.4
react-dom: 19.1.4
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 8