RPG sendToQuickType uses required injector.get unlike SharedExport optional #1069

Closed
opened 2026-08-13 06:33:03 +00:00 by spikerj · 1 comment
Owner

RpgGameComponent.sendToQuickType does:

const { QuickTypeService } = await import("@spikersoft/feature-dev-tools-quick-type");
const quickTypeService = this.injector.get(QuickTypeService);
await quickTypeService.quicktypeJSON(...);

SharedExportComponent.exportToQuickType uses injector.get(QuickTypeService, null, { optional: true }) and warns when the service is missing, still emitting quicktype_success.

If the lazy module loads but the token is not in this injector (or get() throws), RPG always shows the 5s error snackbar. SharedExport degrades. The RPG page already embeds app-shared-export, so the two paths disagree.

Pinned by rpg-game.component.logic.spec.ts (success requires providing QuickTypeService; reject arm snacks the error).

`RpgGameComponent.sendToQuickType` does: ``` const { QuickTypeService } = await import("@spikersoft/feature-dev-tools-quick-type"); const quickTypeService = this.injector.get(QuickTypeService); await quickTypeService.quicktypeJSON(...); ``` `SharedExportComponent.exportToQuickType` uses `injector.get(QuickTypeService, null, { optional: true })` and warns when the service is missing, still emitting `quicktype_success`. If the lazy module loads but the token is not in this injector (or `get()` throws), RPG always shows the 5s error snackbar. SharedExport degrades. The RPG page already embeds `app-shared-export`, so the two paths disagree. Pinned by `rpg-game.component.logic.spec.ts` (success requires providing `QuickTypeService`; reject arm snacks the error).
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.