Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The documentation of the @adminjs/relatoins example is incorrect #1711

Open
tonypinkevych opened this issue Sep 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tonypinkevych
Copy link

tonypinkevych commented Sep 19, 2024

Contact Details

https://discord.com/channels/1134390757755723816/1134399045155180554/1286417341923459103

What happened?

Please update the documentation for your paid @adminjs/relations plugin with the @adminjs/prisma adapter. It has a very unclear behavior.

In your documentation there is an example of options for a resource where you explicitly specify users organizationId and personId:

Screenshot 2024-09-19 at 21 57 55

But it doesn't work and returns very unclear behavior (infinite bootloader) and an error message:

Screenshot 2024-09-19 at 21 59 54 Screenshot 2024-09-19 at 22 00 13

Instead of organizationid it should just point to organization.

Screenshot 2024-09-19 at 21 58 31

Related to this: #1619

Bug prevalence

At first interaction with paid plugin

AdminJS dependencies version

"@adminjs/express": "^6.1.0"
"@adminjs/nestjs": "^6.1.0"
"@adminjs/prisma": "^5.0.3"
"@adminjs/relations": "^1.1.2"

What browsers do you see the problem on?

Chrome

Relevant log output

[22:00:07.338] ERROR (31474): Cannot read properties of null (reading 'type')
    err: {
      "type": "TypeError",
      "message": "Cannot read properties of null (reading 'type')",
      "stack":
          TypeError: Cannot read properties of null (reading 'type')
              at file:///Users/tonypinkevych/Documents/education/node_modules/@adminjs/prisma/src/utils/converters.ts:39:84
              at Array.reduce (<anonymous>)
              at convertFilter (file:///Users/tonypinkevych/Documents/education/node_modules/@adminjs/prisma/src/utils/converters.ts:38:34)
              at Resource.find (file:///Users/tonypinkevych/Documents/education/node_modules/@adminjs/prisma/src/Resource.ts:88:14)
              at oneToManyHandler (file:///Users/tonypinkevych/Documents/education/node_modules/@adminjs/relations/lib/actions/one-to-many/one-to-many.handler.js:1:607)
              at file:///Users/tonypinkevych/Documents/education/node_modules/@adminjs/relations/lib/actions/relations.handler.js:1:727
              at file:///Users/tonypinkevych/Documents/education/node_modules/adminjs/lib/backend/decorators/action/action-decorator.js:98:90
    }

Relevant code that's giving you issues

Can be taken from this example: https://docs.adminjs.co/basics/features/relations. Just copy paste into a project and it doesn't work
@tonypinkevych tonypinkevych added the bug Something isn't working label Sep 19, 2024
@tonypinkevych tonypinkevych changed the title [Bug]: adminjs/relatoins [Bug]: The documentation of the @adminjs/relatoins example is incorrect Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant