payload
payload copied to clipboard
@payloadcms/live-preview-react: Error parsing package.json file "exports" field must be an object or a string
Link to reproduction
No response
Environment Info
This is the package json of my front end head app: {
"name": "web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@payloadcms/live-preview-react": "^0.2.0",
"@web-agency/ui": "*",
"next": "14.2.6",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@web-agency/eslint-config": "*",
"@web-agency/types": "*",
"@web-agency/typescript-config": "*",
"eslint": "^8",
"eslint-config-next": "14.2.6",
"typescript": "^5"
}
}
Describe the Bug
When using the @payloadcms/live-preview-react, I get this error:
./node_modules/@payloadcms/live-preview/package.json Error parsing package.json file "exports" field must be an object or a string
./node_modules/@payloadcms/live-preview-react/package.json Error parsing package.json file "exports" field must be an object or a string
Removing "exports": null from package.json seems to fix it. Seems to be a similar issue to https://github.com/payloadcms/payload-3.0-demo/issues/79 but this is for a sperate head application not the same next application paylaod3.0 lives in
Reproduction Steps
npx create-next-app@latest yarn add @payloadcms/live-preview-react yarn dev
Adapters and Plugins
@payloadcms/live-preview-react