sfmc-devtools
sfmc-devtools copied to clipboard
[BUG] buildTemplate fails if replacements cause JSON string to become invalid JSON
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
depending on the market config and the metadata that bt
is run on, it might result in JSON that's no longer valid.
This invalid JSON is returned by Util.replaceByObject on line 381 in lib/metadataTypes/MetadataType.js and then fails when JSON.parse() is executed on it
problems can look like this:
Expected Behavior
We should try-catch this error and log the invalid json to allow users to debug it.
Steps To Reproduce
- Go to '...'
- Click on '....'
- Run '...'
- See error...
Version
5.0.1
Environment
- OS:
- Node:
- npm:
Participation
- [X] I am willing to submit a pull request for this issue.
Additional comments
No response