You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bicep version Bicep CLI version 0.4.743 (b316af9eee) ms-azuretools.vscode-bicep@0.4.743-gb316af9eee
Describe the bug
If you have a file named bicepconfig.json with no content the CLI will throw an unhandled exception.
Unhandled exception. System.Exception: Could not load configuration file. The input does not contain any JSON tokens. Expected the input to star at Bicep.Core.Semantics.SemanticModel.get_LinterAnalyzer()
at Bicep.Core.Semantics.SemanticModel.GetAnalyzerDiagnostics(ConfigHelper overrideConfig)
at Bicep.Core.Semantics.SemanticModel.AssembleDiagnostics(ConfigHelper overrideConfig)
at Bicep.Core.Semantics.SemanticModel.<.ctor>b__8_5()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Bicep.Core.Semantics.SemanticModel.GetAllDiagnostics(ConfigHelper overrideConfig)
at Bicep.Core.Semantics.Compilation.<>c__DisplayClass12_0.<GetAllDiagnosticsByBicepFile>b__1(BicepFile bicepFile)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at Bicep.Core.Semantics.Compilation.GetAllDiagnosticsByBicepFile(ConfigHelper overrideConfig)
at Bicep.Cli.Services.CompilationService.LogDiagnostics(Compilation compilation)
at Bicep.Cli.Services.CompilationService.CompileAsync(String inputPath, Boolean skipRestore)
at Bicep.Cli.Commands.BuildCommand.RunAsync(BuildArguments args)
at Bicep.Cli.Program.RunAsync(String[] args)
at Bicep.Cli.Program.<Main>(String[] args)
To Reproduce
Create an empty file named bicepconfig.json
Create an empty bicep file named foo.bicep
Run bicep build .\foo.bicep
Additional context
Should not throw an unhandled exception. The error message should let the user know the path to the bicepconfig.json file that can't be loaded.
The VS Code extension handles it better, but again since bicep will look up the tree until it finds a bicepconfig.json file it should let the user know which one to correct.
Could not load configuration file. The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.(Fatal)`
The text was updated successfully, but these errors were encountered:
Bicep version
Bicep CLI version 0.4.743 (b316af9eee)
ms-azuretools.vscode-bicep@0.4.743-gb316af9eee
Describe the bug
If you have a file named
bicepconfig.json
with no content the CLI will throw an unhandled exception.To Reproduce
bicepconfig.json
foo.bicep
bicep build .\foo.bicep
Additional context
Should not throw an unhandled exception. The error message should let the user know the path to the
bicepconfig.json
file that can't be loaded.The VS Code extension handles it better, but again since bicep will look up the tree until it finds a
bicepconfig.json
file it should let the user know which one to correct.The text was updated successfully, but these errors were encountered: