Template Spec errors when changing version or requesting other module
Bicep version Bicep CLI version 0.29.47 (132ade51bc) (has been valid since I've started)
Describe the bug
When using modules from Template Spec, I get the following error at random times a lot:
The referenced ARM template has errors. Please see https://aka.ms/arm-template for information on how to diagnose and fix the template.bicep(BCP188)
I get this on all my modules in Template Spec, and at random times mostly when changing module version or when changing the module name. However, after a restart of vscode it works fine and the error is gone!
To Reproduce Upload modules to template spec and try different versions, change references to different modules. It will show errors, however after a restart of vscode it will be fixed and you can deploy!
Additional context I didn't seem to notice this error when we were using ACR however, we need Template Spec because our templates have become way to big and Template Spec seems to use templatelink where ACR embeds the content of the referred template. Do note that my modules use lots of user defined functions and types!
@stephaniezyen will this be looked at before 0.30? Or is the adoption of TS instead of ACR too low to prioritize this?
Hi @cedricbraekevelt apologies for the delay. I'm prioritizing this now.
While I couldn't reproduce the issue by updating the template spec version in the module reference string, I consistently encountered the same error when using the Go to definition command for the template spec module. This seems to be an unintended regression from a previous effort to improve the user experience when peeking into the source files of external registry modules.
Hi @shenglol,
Didn't want to stress you guys, was just curious where this issue was located in the prio list ;) Thanks for investigating, I'll be sure to test this out. PS: I'm working with AZ Pwsh credential precedence towards TS. (As I'm mainly using AZ Pwsh, not AZ CLI).
@shenglol Is there any other way I can generate logs from loading these modules?
@cedricbraekevelt I've submitted a PR to address the issue. We're planning to publish a release soon. In the meantime, you can try the nightly build to see if the fix resolves the problem.