From 3f6d1e8ed7cd8748c0568f5f0f93063a0d563a1d Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 13 Sep 2026 15:50:58 +0200 Subject: [PATCH] fix(accommodations): re-export the module, not the provider inside it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The container refused to boot: Nest will not export a provider that belongs to an imported module, and the service moved into the domain module in the commit before. Re-exporting that module gives every importer the same service it always got, and the wiring test now asserts the shape that actually boots rather than the one that only typechecks. Neither tsc nor the unit tests could see this — the module metadata is only read when a container is built. The e2e harness does build one, and that is what catches it. --- server/src/nest/accommodations/accommodations.module.ts | 6 ++++-- server/tests/unit/nest/accommodations.service.test.ts | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/server/src/nest/accommodations/accommodations.module.ts b/server/src/nest/accommodations/accommodations.module.ts index 37b0ecab8..32cdab332 100644 --- a/server/src/nest/accommodations/accommodations.module.ts +++ b/server/src/nest/accommodations/accommodations.module.ts @@ -1,6 +1,5 @@ import { Module } from '@nestjs/common'; import { AccommodationsController } from './accommodations.controller'; -import { AccommodationsService } from './accommodations.service'; import { AccommodationsRpc } from './accommodations.rpc'; import { AccommodationsMcp } from './accommodations.mcp'; import { PlacesModule } from '../places/places.module'; @@ -32,6 +31,9 @@ import { McpSharedModule } from '../mcp-shared/mcp-shared.module'; imports: [McpSharedModule, PermissionsModule, RealtimeModule, PluginGuardsModule, DatabaseModule, PlacesModule, AccommodationsDomainModule, AuthModule], controllers: [AccommodationsController], providers: [AccommodationsRpc, AccommodationsMcp], - exports: [AccommodationsService], + // The MODULE, not the provider: Nest refuses to export a provider that belongs to + // an imported module, and the service lives in the domain module now. Re-exporting + // the module gives every existing importer the same service it always got. + exports: [AccommodationsDomainModule], }) export class AccommodationsModule {} diff --git a/server/tests/unit/nest/accommodations.service.test.ts b/server/tests/unit/nest/accommodations.service.test.ts index 7fcebc3fd..1e7f24c74 100644 --- a/server/tests/unit/nest/accommodations.service.test.ts +++ b/server/tests/unit/nest/accommodations.service.test.ts @@ -840,9 +840,12 @@ describe('AccommodationsService wiring', () => { expectRegisteredProvider(AccommodationsDomainModule, AccommodationsService); const imports = Reflect.getMetadata('imports', AccommodationsModule) as unknown[]; expect(imports).toEqual(expect.arrayContaining([AccommodationsDomainModule])); + // The MODULE is re-exported, not the provider: Nest refuses to export a provider + // belonging to an imported module, and a boot that fails on that only shows up when + // the container is actually built. const exports = Reflect.getMetadata('exports', AccommodationsModule) as unknown[]; expect(Array.isArray(exports)).toBe(true); - expect(exports).toEqual(expect.arrayContaining([AccommodationsService])); + expect(exports).toEqual(expect.arrayContaining([AccommodationsDomainModule])); }); it('ACC-001b: the domain module reaches neither places nor the surfaces', () => {