SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js

Home Page:https://adminjs.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Dr4CuK30 opened this issue · comments

Discussed in #1648

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

I was facing the same issue and suspected the regression was introduced here

I downgraded to the version before the update and it worked again.

But then I realized that the bundling approach was not really "production-like", so I chose to add @adminjs/bundler and add an assets bundling step to my CI. Now everything works on the most recent version.