readme-generator-for-helm icon indicating copy to clipboard operation
readme-generator-for-helm copied to clipboard

A list inside a File.ext YAML key pattern is not correctly parsed

Open kuisathaverat opened this issue 2 years ago • 2 comments

I found the following error message for a valid values YAML file

/folder/readme-generator-for-helm/lib/parser.js:147
        _.get(valuesJSON, arrayPrefix).forEach((e) => {
                                      ^

TypeError: Cannot read property 'forEach' of undefined
    at createValuesObject (/folder/readme-generator-for-helm/lib/parser.js:147:39)
    at getParsedMetadata (/folder/readme-generator-for-helm/index.js:22:24)
    at runReadmeGenerator (/folder/readme-generator-for-helm/index.js:52:28)
    at Object.<anonymous> (/folder/readme-generator-for-helm/bin/index.js:22:1)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47
make: *** [readme] Error 1

This is the yaml file, it contains a key with a . because it references a file.ext pattern, this key contains a list that is where the parse error happens.

## section foo bar
## @param foo.file.ext.foo bar
foo:
  file.ext:
    foo:
      - bar

Removing the file.ext key the parser pass.

In my case, I am creating a Helm Chart on top of the Grafana Helm Chart and defining a Grafana dashboardProviders

The main problem here is that it was not easy to find what caused the error.

kuisathaverat avatar Feb 02 '23 16:02 kuisathaverat

Sorry for my very late response

I've just created an internal task to work on this issue. I hope to come back soon.

fmulero avatar Mar 12 '24 10:03 fmulero

Facing same issue , sent a PR

junaid18183 avatar Aug 29 '24 07:08 junaid18183