payload icon indicating copy to clipboard operation
payload copied to clipboard

plugin-form-builder: Compatibility with Payload 2.0

Open matteo-naif opened this issue 2 years ago • 5 comments

Hello, I have a problem updating to the latest version of Payload. Installing the dependencies I have the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/payload
npm ERR!   payload@"^2.0.10" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer payload@"^0.18.5 || ^1.0.0" from @payloadcms/[email protected]
npm ERR! node_modules/@payloadcms/plugin-form-builder
npm ERR!   @payloadcms/plugin-form-builder@"1.0.15" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

and my package.json is the following

"dependencies": {
  "@aws-sdk/client-s3": "^3.430.0",
  "@aws-sdk/lib-storage": "^3.430.0",
  "@mailchimp/mailchimp_marketing": "^3.0.80",
  "@payloadcms/plugin-cloud-storage": "^1.1.1",
  "@payloadcms/plugin-form-builder": "1.0.15",
  "@payloadcms/plugin-nested-docs": "^1.0.8",
  "@payloadcms/plugin-seo": "^1.0.15",
  "@tinymce/tinymce-react": "^4.3.0",
  "crypto-browserify": "^3.12.0",
  "csvtojson": "^2.0.10",
  "dotenv": "^16.3.1",
  "express": "^4.18.2",
  "path-browserify": "^1.0.1",
  "payload": "^2.0.10",
  "payload-swagger": "^1.4.0",
  "querystring-es3": "^0.2.1",
  "react-colorful": "^5.6.1",
  "slugify": "^1.6.6",
  "tinymce": "^6.7.0"
},
"devDependencies": {
  "@types/express": "^4.17.20",
  "@types/mailchimp__mailchimp_marketing": "^3.0.16",
  "@typescript-eslint/eslint-plugin": "^6.8.0",
  "@typescript-eslint/parser": "^6.8.0",
  "copyfiles": "^2.4.1",
  "cross-env": "^7.0.3",
  "eslint": "8.51.0",
  "nodemon": "^3.0.1",
  "prettier": "2.5.1",
  "ts-node": "^10.9.1",
  "typescript": "^5.2.2"
}

How can I install safely plugin-form-builder?

matteo-naif avatar Oct 18 '23 12:10 matteo-naif

Looks like we're waiting on this PR to resolve the peer deps message https://github.com/payloadcms/plugin-form-builder/pull/63

Since you appear to be using npm, the workaround for now is to do npm install --legacy-peer-deps or include an .npmrc file in your repo with legacy-peer-deps=true.

denolfe avatar Oct 18 '23 17:10 denolfe

Ok, thanks. At the moment I tried with the flag --force. In your opinion, is the same or is better --legacy-peer-deps?

matteo-naif avatar Oct 19 '23 07:10 matteo-naif

Any updates on this? Running form builder just fine on 2.0 locally via --legacy-peer-deps but running into issues when deploying to Vercel, using next-payload.

ghost avatar Oct 26 '23 00:10 ghost

I also just opened a PR for this very quick fix in the mean time. payloadcms/plugin-form-builder#67 Here is a link to a personal package I published while waiting for the fix.

treturner avatar Nov 09 '23 01:11 treturner

This plugin is now being maintained in the Packages Directory of the Payload Monorepo. This repo will soon be archived and all open issues be closed. This issue, however, will be transferred over. Please refer to this open discussion for more details.

It does appear that the peer dependencies are correct in the new source code here, but just hasn't yet been published yet. We'll get this released as soon as possible. Thank you everyone for reporting on this.

jacobsfletch avatar Dec 12 '23 22:12 jacobsfletch

@matteo-naif @ficeco @treturner New release for the plugin was published - 1.1.0 - so the correct peer dependencies are in place.

Closing this issue now.

PatrikKozak avatar Jan 04 '24 13:01 PatrikKozak