TwentyT
Twenty2y ago
17 replies
JarWarren

Help understanding the difference between `npx nx start` and `yarn command:prod`

I added a single new dependency (RelationMetadataModule) to WorkspaceManagerModule so I could run some logic when a workspace is activated.

This always succeeds via npx nx start. It always fails via yarn command:prod.
/Users/jarwarren/funnelmink/crm/packages/twenty-server/dist/src/engine/metadata-modules/relation-metadata/relation-metadata.service.js:8
        return RelationMetadataService;
        ^

ReferenceError: Cannot access 'RelationMetadataService' before initialization


Thus, I can't commit my changes or I'll be blocked from using yarn command:prod for future migrations. Fwiw, using forwardRef doesn't fix.

The fact the Modules are valid with npx nx start makes me think this is a quirk of how command.ts starts the app. It probably also explains why forwardRef has no effect.

Can someone who's familiar with the codebase/NestJS explain the difference? I'm guessing it's a simple remedy for someone who knows what they're doing (clearly not me 😅 )
Captura_de_pantalla_2024-08-22_a_las_10.47.36_a.m..png
Captura_de_pantalla_2024-08-22_a_las_9.58.26_p.m..png
Was this page helpful?