adminjs: @adminjs/relations rendering error: Error: Component "RelationsShowPropertyComponent" has not been bundled

Discussed in https://github.com/SoftwareBrothers/adminjs/discussions/1648

<div type='discussions-op-text'>

Originally posted by Dr4CuK30 April 2, 2024 Hello guys,

I wrote a implementation of relations (one to many and many to many) using the @adminjs/relations but is generating the following error in the visual generated resources that have this relations:

Captura de pantalla 2024-04-02 a la(s) 2 56 55 p  m

This is the browser console output: Captura de pantalla 2024-04-02 a la(s) 2 58 20 p  m

And this is my resources: const createStreamingResource = () => ({ resource: Streaming, options: { navigation: { icon: 'Users' }, }, features: [ owningRelationSettingsFeature({ componentLoader, licenseKey: process.env.LICENSE_KEY, relations: { members: { type: RelationType.ManyToMany, junction: { joinKey: 'streamingId', inverseJoinKey: 'collaboratorId', throughResourceId: 'StreamingCollaborator', }, target: { resourceId: 'Collaborator', }, }, }, }), ], }); And my packege.json: Captura de pantalla 2024-04-02 a la(s) 3 02 34 p  m

</div>

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 8
  • Comments: 17 (3 by maintainers)

Most upvoted comments

I had the same issue on production where I use @adminjs/bundler and it didn’t bundle relations components as the internal bundleRelationsComponents wasn’t called. I added a call of empty owningRelationSettingsFeature in my components.ts and it started including relations components.

export const relationComponents = owningRelationSettingsFeature({
  componentLoader,
  licenseKey: RELATIONS_LICENSE_KEY,
  relations: {}
});

@AntonOrnatskyi here is an example of a working project with this plugin. you might be happy to take some inspiration: https://github.com/androz2091-business/restriction-discord-bot/blob/main/src/database.ts