The error says `Incorrect type. Expected "object"`
The caches: -node syntax is taken from the example on the chaching dependencies page right here:
https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html
Hi Andrey,
Could you please post a full YAML sample as a "Code block" (ie. so we can see exactly how the YAML is formatted). You can find the "Code block" option in the "Formats" menu in the editor.
Hi Steven,
Thank you for the reply. Here is an example of how the YAML is formatted:
branches:
master:
- step:
name: Test & Build
image: node:11.9.0
caches:
- node
script:
- yarn
- yarn global add @angular/cli
.................................
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The keywords "name", "image" etc. need to be indented further than the "step" keyword:
branches:
master:
- step:
name: Test & Build
image: node:11.9.0
caches:
- node
script:
- yarn
- yarn global add @angular/cli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies for the misleading post. Yes, they are in my yaml. VSC has a very strict setting and all the indentation errors are highlighted.
The code block formatter did not work properly so I indented the lines manually here.
The point is that the line with ‘-node’ is marked as wrong syntax and I cannot find out why.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I see. And just to be clear, this is only marked as an error in VSC? If you commit the file with the error does it work in Pipelines?
Have you tried enclosing the string in quotes? Eg.
caches:
- 'node'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, correct. It is only marked as an error in VSC, but the node modules get cached in the Pipelines anyways.
Enclosing it in quotes has no effect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I agree, it looks like a bug in the extension. I recommend you raise an issue as described here: https://community.atlassian.com/t5/Bitbucket-articles/Try-Atlassian-for-VS-Code-New-Bitbucket-and-Jira-Software-Cloud/ba-p/1017882?_ga=2.15029814.1036991494.1565704145-165653393.1544177540
Edit: In fact this issue is related and someone has already commented on the problem with "caches" https://bitbucket.org/atlassianlabs/atlascode/issues/66/yaml-validator-inconsistent-with-online
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.