-
Notifications
You must be signed in to change notification settings - Fork 762
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
Template Spec errors when changing version or requesting other module #14660
Comments
@stephaniezyen will this be looked at before 0.30? |
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. |
The "Go to Definition" feature for template specs in VS Code is currently broken. When used, it opens the template spec JSON file in an editable state, though it should be read-only. This action then triggers the `documentDidOpen` event for the JSON file, which leads to a compilation update for the template spec module. As a result, the Bicep compiler mistakenly interprets the template spec JSON file as an ARM template, causing an `The reference ARM template has errors` message. This PR aims to fix that issue. The problem was initially identified during the investigation of issue #14660. However, this PR might not fully resolve the issue, as according to the customer, the `The reference ARM template has errors` message can still appear randomly, even when "Go to Definition" is not used. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/14871)
Hi @shenglol, Didn't want to stress you guys, was just curious where this issue was located in the prio list ;) |
@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. |
Bicep version
Bicep CLI version 0.29.47 (132ade5) (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:
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!
The text was updated successfully, but these errors were encountered: