ijsto/strapi-plugin-migrate

Detail Form & New Collection Item Form fail

CodingAleCR opened this issue · 4 comments

Describe the bug
After uploading the permissions file, Strapi fails to load the detail form and the new collection item form. The error shows

Something went wrong.
Details
Cannot read properties of undefined (reading 'code')
TypeError: Cannot read properties of undefined (reading 'code')
    at h (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:9101115)
    at Ka (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4271509)
    at gl (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4317915)
    at cs (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4310448)
    at ls (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4310373)
    at Xl (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4307382)
    at https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4258767
    at t.unstable_runWithPriority (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4334347)
    at Vo (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4258476)
    at Yo (https://ticda-api-dev.herokuapp.com/admin/main.6971d80e.chunk.js:1:4258712)

To Reproduce
Steps to reproduce the behavior:

  1. Export User Permissions with a public role that only has access to find operations from localhost running environment.
  2. Import User Permissions in a separate environment (e.g. Heroku).
  3. Open Collection table (any) that already had items in it.
  4. Open any item in the table.

Expected behavior
Application opens detail form and saves/works as usual.

Screenshots

Screen Shot 2022-03-05 at 23 19 47

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 98

Additional context

  • It also fails to load the "Add item" form on tables that did not contain any other items, meaning on empty tables.
  • Local environment uses develop command, while Heroku uses a production configuration.

Hey @CodingAleCR thanks for opening the issue will try to get to this sometime in near future. In the meantime, please feel free to open a PR, if you happen to find a solution

Thank you, if I can find it for sure I will make a PR as it's somewhat urgent for me, but I completely understand open source development so no pressure on you.

Thanks for answering quickly and for the plugin itself. Kudos!

In the end, the only thing that managed to fix my issue was to reset strapi to the beginning by deleting all tables and restarting the server. After that I did not manage to make the error surface again, a couple others occurred but I'm not sure that they were caused by the plugin.

In any case, I think it makes sense to close the issue and open a new one if the error happens to others as well. Cheers!

Great, thanks for providing this context! Sorry to hear you had to reset, but glad you're back on track! Cheers