joas8211 / payload-tenancy

Multi-tenancy plugin for Payload CMS
MIT License
122 stars 6 forks source link

Installing plugin brakes the Admin UI (payload "^1.8.2") #14

Closed mpresecan closed 1 year ago

mpresecan commented 1 year ago

When installed package it brakes the Admin UI. Also tested several times on a blank Payload CMS project just to install payload-tenancy (npm install payload-tenancy) it brakes the admin UI, and when uninstalled the plugin, it is still broken.

React error: Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

joas8211 commented 1 year ago

Are you using the latest version (v1.0.1)? Just making sure, because there was that kind of problem in v1.0.0.

joas8211 commented 1 year ago

I cannot reproduce the issue with payload 1.8.2 and payload-tenancy 1.0.1.

I tried using NPM as you suggested:

$ npx create-payload-app

  Welcome to Payload. Let's create a project! 

✔ Project name? … payload-tenancy-test
✔ Choose project template › blank
✔ Enter MongoDB connection … mongodb://localhost/payload-tenancy-test

[...]

$ cd payload-tenancy-test
$ npm install payload-tenancy
$ # Modified payload.config.ts to have the plugin and tenant collection in it. 
$ npm run dev

I'm hoping this is a non-issue and so I close it. I can reopen it if you still have an issue.

MRVDOG commented 1 year ago

Just to chime in here, I don't think this is an issue with this project, I also had the same error popup, and it was showing as react-toastify, I fixed it by deleting my package-lock.json and the node_modules and re-installing them, just deleting node_modules didn't seem to make a difference for me. hope this helps resolve the op's issue😄