{"record":{"id":"bb1ec7d4c21665c3","repo":"anomalyco/sst","slug":"cannot-access-nodes-cloudmapservice-in-dev-mode","errorCode":null,"errorMessage":"Cannot access `nodes.cloudmapService` in dev mode.","messagePattern":"Cannot access `nodes\\.cloudmapService` in dev mode\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/service.ts","lineNumber":2932,"sourceCode":"          );\n        return self.loadBalancer;\n      },\n      /**\n       * The Amazon Application Auto Scaling target.\n       */\n      get autoScalingTarget() {\n        if (self.dev)\n          throw new VisibleError(\n            \"Cannot access `nodes.autoScalingTarget` in dev mode.\",\n          );\n        return self.autoScalingTarget!;\n      },\n      /**\n       * The Amazon Cloud Map service.\n       */\n      get cloudmapService() {\n        if (self.dev)\n          throw new VisibleError(\n            \"Cannot access `nodes.cloudmapService` in dev mode.\",\n          );\n\n        return output(self.cloudmapService).apply((service) => {\n          if (!service)\n            throw new VisibleError(\n              `Cannot access \"nodes.cloudmapService\" for the \"${self._name}\" Service. Cloud Map is not configured for the cluster.`,\n            );\n          return service;\n        });\n      },\n    };\n  }\n\n  /** @internal */\n  public getSSTLink() {\n    return {\n      properties: {","sourceCodeStart":2914,"sourceCodeEnd":2950,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/service.ts#L2914-L2950","documentation":"`nodes.cloudmapService` exposes the AWS Cloud Map service used for service discovery. In dev mode no Cloud Map service resource is created, so the getter throws this VisibleError before even evaluating whether Cloud Map is configured on the cluster.","triggerScenarios":"Reading `service.nodes.cloudmapService` while `sst dev` is running on a Service component.","commonSituations":"Custom service-discovery wiring or DNS lookups referencing the Cloud Map service; code written against a deployed environment then run under `sst dev` for local development.","solutions":["Gate the access with `$dev` from `sst/dev` and provide a dev-mode alternative (e.g. the `dev.url`/`devPassword` style endpoints the component exposes).","Run `sst deploy` if the Cloud Map resource is genuinely needed.","Also ensure Cloud Map is configured for the cluster; in deploy mode the same getter throws a separate 'Cloud Map is not configured' error."],"exampleFix":"// before\nconst cm = service.nodes.cloudmapService;\n\n// after\nimport { $dev } from \"sst/dev\";\nconst cm = $dev ? undefined : service.nodes.cloudmapService;","handlingStrategy":"validation","validationCode":"import { $dev } from \"sst/dev\";\nif (!$dev) {\n  const cm = service.nodes.cloudmapService; // also requires Cloud Map configured for the cluster\n}","typeGuard":"import { $dev } from \"sst/dev\";\nconst hasCloudmapService = (): boolean => !$dev;","tryCatchPattern":"try {\n  const cm = service.nodes.cloudmapService;\n} catch (e) {\n  if (String(e).includes(\"cloudmapService\")) {\n    // dev mode or Cloud Map not configured; use alternative discovery\n  } else throw e;\n}","preventionTips":["Use `$dev` gating for all service-discovery node access.","Ensure the cluster's Cloud Map settings are configured when relying on discovery in deploy mode.","Prefer the Service's built-in dev URL/endpoints instead of Cloud Map during local development."],"tags":["dev-mode","cloudmap","service-discovery","nodes"],"backgroundTag":"resource-unavailable-in-dev-mode","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}