Solution skill
WhatsApp media templates missing from HSMContentContent TypeScript types
Complete solution
Shows how to fix whatsApp media templates missing from HSMContentContent TypeScript types. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The maintainer pushed a fix for the HSM types; the reporter then found HSMComponentDocumentParameter and HSMComponentImageParameter were still missing and that params was wrongly mandatory (causing "hsm params and components can not be set at the same time (code: 21)"), and opened PR #84 with the fix.
Steps
- Issue messagebird/messagebird-nodejs#82 (closed, 4 comments): a reporter adding a media template hit a TypeScript error setting the components property on the HSMContentContent interface, which had no components at all. The maintainer pushed a fix for the HSM types; the reporter then found HSMComponentDocumentParameter and HSMComponentImageParameter were still missing and that params was wrongly mandatory (causing "hsm params and components can not be set at the same time (code: 21)"), and opened PR #84 with the fix.
- If you send WhatsApp media templates through the Node SDK and TypeScript complains about components on HSMContentContent, update the SDK to a version that includes the type fixes from PR #84. The HSMComponentParameter type now covers document and image parameters, and params is no longer mandatory alongside components. If you instead hit "hsm params and components can not be set at the same time (code: 21)", check that you are not setting params and components together in the same request.
When to use
You are seeing this: Issue messagebird/messagebird-nodejs#82 (closed, 4 comments): a reporter adding a media template hit a TypeScript error setting the components property on the HSMContentContent interface, which had no components at all. Use this skill when you run into "WhatsApp media templates missing from HSMContentContent TypeScript types".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/messagebird/messagebird-nodejs/issues/82
Evidence
In gh:messagebird/messagebird-nodejs#82, the reporter ran into: Issue messagebird/messagebird-nodejs#82 (closed, 4 comments): a reporter adding a media template hit a TypeScript error setting the components property on the HSMContentContent interface, which had no components at all. The maintainer pushed a fix for the HSM types; the reporter then found HSMComponentDocumentParameter and HSMComponentImageParameter were still missing and that params was wrongly mandatory (causing "hsm params and components can not be set at the same time (code: 21)"), and opened PR #84 with the fix. The verified answer was: If you send WhatsApp media templates through the Node SDK and TypeScript complains about components on HSMContentContent, update the SDK to a version that includes the type fixes from PR #84. The HSMComponentParameter type now covers document and image parameters, and params is no longer mandatory alongside components. If you instead hit "hsm params and components can not be set at the same time (code: 21)", check that you are not setting params and components together in the same request. Source issue: https://github.com/messagebird/messagebird-nodejs/issues/82
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_-2fiJ95TzDOgc3Np8Uaj7A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">WhatsApp media templates missing from HSMContentContent TypeScript types <span>— Vectle</span></a>