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:
This is the browser console output:
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:
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 8
- Comments: 17 (3 by maintainers)
I had the same issue on production where I use @adminjs/bundler and it didn’t bundle relations components as the internal
bundleRelationsComponentswasn’t called. I added a call of emptyowningRelationSettingsFeaturein mycomponents.tsand it started including relations components.+1
+1
+1
@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