Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build template fails with exception on "resource<'Microsoft.Compute/virtualMachines/extensions@2019-12-01'>.properties.settings" #15277

Open
StephenWeatherford opened this issue Oct 11, 2024 · 0 comments · May be fixed by #15901
Assignees
Milestone

Comments

@StephenWeatherford
Copy link
Contributor

Bicep:

type resourceDerived = resource<'Microsoft.Compute/virtualMachines/extensions@2019-12-01'>.properties.settings

bicepconfig.json:

{
  "experimentalFeaturesEnabled": {
    "resourceDerivedTypes": true,
    "resourceTypedParamsAndOutputs": true
  }
}

Right click -> Build ARM Template

Exception thrown, and you get an empty .json output file:
Image

[Trace - 9:43:15 AM] Received response 'workspace/executeCommand - (430)' in 4ms. Request failed: Internal Error - System.ArgumentException: Cannot resolve nonliteral type name of type AnyType
   at Bicep.Core.Emit.TemplateWriter.GetNonLiteralTypeName(TypeSymbol type) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 961
   at Bicep.Core.Emit.TemplateWriter.ResourceDerivedTypeResolution.GetTypePropertiesForResolvedReferenceExpression(SyntaxBase sourceSyntax) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 475
   at Bicep.Core.Emit.TemplateWriter.GetTypePropertiesForReferenceExpression(TypeExpression typeExpression) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 444
   at Bicep.Core.Emit.TemplateWriter.TypePropertiesForTypeExpression(TypeExpression typeExpression) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 398
   at Bicep.Core.Emit.TemplateWriter.<>c__DisplayClass29_0.<EmitTypeDeclaration>b__0() in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 366
   at Bicep.Core.Emit.PositionTrackingJsonTextWriter.WriteObjectWithPosition(IPositionable sourcePosition, Action propertiesFunc) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\PositionTrackingJsonTextWriter.cs:line 94
   at Bicep.Core.Emit.ExpressionEmitter.EmitObject(Action writePropertiesFunc, IPositionable position) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 417
   at Bicep.Core.Emit.ExpressionEmitter.<>c__DisplayClass32_0.<EmitObjectProperty>b__0() in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 411
   at Bicep.Core.Emit.PositionTrackingJsonTextWriter.WritePropertyWithPosition(IPositionable keyPosition, String name, Action valueFunc) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\PositionTrackingJsonTextWriter.cs:line 116
   at Bicep.Core.Emit.ExpressionEmitter.EmitProperty(String propertyName, Action writeValueFunc, IPositionable position) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 405
   at Bicep.Core.Emit.ExpressionEmitter.EmitObjectProperty(String propertyName, Action writePropertiesFunc, IPositionable position) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 411
   at Bicep.Core.Emit.TemplateWriter.EmitTypeDeclaration(ExpressionEmitter emitter, DeclaredTypeExpression declaredType) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 363
   at Bicep.Core.Emit.TemplateWriter.<>c__DisplayClass20_0.<EmitTypeDefinitionsIfPresent>b__0() in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 163
   at Bicep.Core.Emit.PositionTrackingJsonTextWriter.WriteObjectWithPosition(IPositionable sourcePosition, Action propertiesFunc) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\PositionTrackingJsonTextWriter.cs:line 94
   at Bicep.Core.Emit.ExpressionEmitter.EmitObject(Action writePropertiesFunc, IPositionable position) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 417
   at Bicep.Core.Emit.ExpressionEmitter.<>c__DisplayClass32_0.<EmitObjectProperty>b__0() in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 411
   at Bicep.Core.Emit.PositionTrackingJsonTextWriter.WritePropertyWithPosition(IPositionable keyPosition, String name, Action valueFunc) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\PositionTrackingJsonTextWriter.cs:line 116
   at Bicep.Core.Emit.ExpressionEmitter.EmitProperty(String propertyName, Action writeValueFunc, IPositionable position) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 405
   at Bicep.Core.Emit.ExpressionEmitter.EmitObjectProperty(String propertyName, Action writePropertiesFunc, IPositionable position) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\ExpressionEmitter.cs:line 411
   at Bicep.Core.Emit.TemplateWriter.EmitTypeDefinitionsIfPresent(ExpressionEmitter emitter, IEnumerable`1 types) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 159
   at Bicep.Core.Emit.TemplateWriter.GenerateTemplateWithoutHash(PositionTrackingJsonTextWriter jsonWriter) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 130
   at Bicep.Core.Emit.TemplateWriter.Write(SourceAwareJsonTextWriter writer) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateWriter.cs:line 81
   at Bicep.Core.Emit.TemplateEmitter.<>c__DisplayClass8_0.<Emit>b__0() in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateEmitter.cs:line 117
   at Bicep.Core.Emit.TemplateEmitter.EmitOrFail(Func`1 write) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateEmitter.cs:line 138
   at Bicep.Core.Emit.TemplateEmitter.Emit(TextWriter textWriter) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateEmitter.cs:line 103
   at Bicep.Core.Emit.TemplateEmitter.Emit(Stream stream) in C:\__w\1\s\bicep\src\Bicep.Core\Emit\TemplateEmitter.cs:line 96
   at Bicep.LanguageServer.Handlers.BicepBuildCommandHandler.GenerateCompiledFileAndReturnBuildOutputMessageAsync(String bicepFilePath, DocumentUri documentUri) in C:\__w\1\s\bicep\src\Bicep.LangServer\Handlers\BicepBuildCommandHandler.cs:line 71
   at Bicep.LanguageServer.Handlers.BicepBuildCommandHandler.Handle(String bicepFilePath, CancellationToken cancellationToken) in C:\__w\1\s\bicep\src\Bicep.LangServer\Handlers\BicepBuildCommandHandler.cs:line 42
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|7_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)
   at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass10_0.<<RouteRequest>b__5>d.MoveNext() (-32603).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment