{"record":{"id":"154800c168a6e661","repo":"microsoft/aspire","slug":"deno-apps-cannot-be-debugged-through-the-node-dev-server","errorCode":null,"errorMessage":"Deno apps cannot be debugged through the Node dev-server debug path. '{resource.Name}' is a DenoAppResource; use AddDenoApp, which wires its own Deno debug support.","messagePattern":"Deno apps cannot be debugged through the Node dev-server debug path\\. '(.+?)' is a DenoAppResource; use AddDenoApp, which wires its own Deno debug support\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs","lineNumber":2877,"sourceCode":"\n    [Experimental(\"ASPIREEXTENSION001\", UrlFormat = \"https://aka.ms/aspire/diagnostics/{0}\")]\n    internal static IResourceBuilder<T> WithVSCodeDebugging<T>(this IResourceBuilder<T> builder)\n        where T : JavaScriptAppResource\n    {\n        ArgumentNullException.ThrowIfNull(builder);\n\n        var resource = builder.Resource;\n        var workingDirectory = Path.GetFullPath(resource.WorkingDirectory);\n\n        if (resource is BunAppResource)\n        {\n            throw new InvalidOperationException(\n                $\"Bun apps cannot be debugged through the Node dev-server debug path. '{resource.Name}' is a {nameof(BunAppResource)}; use {nameof(AddBunApp)}, which wires its own Bun debug support.\");\n        }\n\n        if (resource is DenoAppResource)\n        {\n            throw new InvalidOperationException(\n                $\"Deno apps cannot be debugged through the Node dev-server debug path. '{resource.Name}' is a {nameof(DenoAppResource)}; use {nameof(AddDenoApp)}, which wires its own Deno debug support.\");\n        }\n\n        return builder.WithDebugSupport(\n            mode =>\n            {\n                // Fall back to \"npm\" (the default for these frameworks) if no package manager annotation is present.\n                var packageManager = \"npm\";\n                if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation))\n                {\n                    packageManager = pmAnnotation.ExecutableName;\n                }\n\n                return new JavaScriptLaunchConfiguration(\"node\")\n                {\n                    ScriptPath = string.Empty,\n                    Mode = mode,\n                    RuntimeExecutable = packageManager,","sourceCodeStart":2859,"sourceCodeEnd":2895,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs#L2859-L2895","documentation":"Like the Bun case, the Node dev-server debug path cannot attach to Deno. Deno apps get their own debug wiring via AddDenoApp; calling the Node-specific debug extension on a DenoAppResource is unsupported and throws with a pointer to the correct API.","triggerScenarios":"Calling the Node dev-server debug extension on a builder whose resource is a DenoAppResource created via AddDenoApp.","commonSituations":"Generic debug setup helpers that treat all JavaScript runtimes alike; a project migrated from Node to Deno while keeping the Node debug extension call; examples copied between AppHosts with different runtimes.","solutions":["Use AddDenoApp, which wires Deno's own debug support, and drop the Node debug extension call.","In shared helpers, gate the Node debug extension on the resource not being DenoAppResource/BunAppResource.","Configure Deno's inspector (--inspect) directly via args if custom debug settings are needed."],"exampleFix":"// before\nbuilder.AddDenoApp(\"app\", \"./app\")\n    .WithNodeDevServerDebugSupport();\n// after\nbuilder.AddDenoApp(\"app\", \"./app\"); // AddDenoApp already wires Deno debug support","handlingStrategy":"type-guard","validationCode":"if (resource is not DenoAppResource)\n    builder.WithNodeDevServerDebugSupport();","typeGuard":"bool SupportsNodeDevServerDebug(IResource r) => r is not DenoAppResource and not BunAppResource;","tryCatchPattern":"try { builder.WithNodeDevServerDebugSupport(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"DenoAppResource\"))\n{\n    // Deno debug support is already wired by AddDenoApp; nothing to do\n}","preventionTips":["In shared debug-setup helpers, branch on runtime type (Node vs Bun vs Deno).","Never apply Node-specific extensions to DenoAppResource builders.","Let AddDenoApp own Deno debug wiring; use --inspect args for custom settings."],"tags":["aspire","javascript","deno","debugging","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}