shunkosa/sfdx-cmdt-plugin

Conversion fails with "Cannot set property 'pretty' of undefined"

Closed this issue · 5 comments

Hello! I hope you're well.

This plugin used to work for me but I'm now getting these errors and the conversion doesn't work. I'm not sure if the problem is with me so I thought I'd post here just in case. Here's the error:

TypeError: Cannot set property 'pretty' of undefined
    at Convert.generateMetadataRecord (/Users/louis/.local/share/sfdx/node_modules/sfdx-cmdt-plugin/lib/commands/cmdt/csv/convert.js:133:31)
    at Parser.csvstream.pipe.on (/Users/louis/.local/share/sfdx/node_modules/sfdx-cmdt-plugin/lib/commands/cmdt/csv/convert.js:100:22)
    at Parser.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at Parser.Readable.push (_stream_readable.js:220:10)
    at Parser.Transform.push (_stream_transform.js:151:32)
    at Parser.__push (/Users/louis/.local/share/sfdx/node_modules/sfdx-cmdt-plugin/node_modules/csv-parse/lib/index.js:857:10)
    at Parser.__onRow (/Users/louis/.local/share/sfdx/node_modules/sfdx-cmdt-plugin/node_modules/csv-parse/lib/index.js:746:30)
    at Parser.__parse (/Users/louis/.local/share/sfdx/node_modules/sfdx-cmdt-plugin/node_modules/csv-parse/lib/index.js:644:34)```

Thank you!

@louisskelton Thank you for reporting the issue! Could you please upload the source of the metadata here?

Hello! I've attached the csv in a zip file.

I was using the command sfdx cmdt:csv:convert customMetadataFiles/Flow_Screen_Field5.csv -t Flow_Screen_Field__mdt

Thanks so much for taking a look :)

Flow_Screen_Field5.csv.zip

This is what sfdx version spits out:

sfdx-cli/7.54.4-8ff9ba9cc5 darwin-x64 node-v10.15.3

Oh, there's something mistake in the source. I just updated this library to v.0.0.7. Could you please try sfdx plugins:update and try to convert again?

@shunkosa - that worked! Thank you soooooo much :) 👍