microsoft / microsoft/AdaptiveCards
[Designer] Template expansion error: Cannot read properties of undefined (reading 'dataType') activating preview mode
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Problem Description
Seen in designer V 2.4.1
When activating preview mode in the designer if;
- The binding preview mode is not set to
SampleData - The designer has not been initialised via the
New carddialog
Preview mode will not be displayed and an error Template expansion error: Cannot read properties of undefined (reading 'dataType') is logged on the browser console.
This can be readily reproduced in the adaptivecard-designer-app by commenting out the line 321 of app.ts (designer.bindingPreviewMode = ACDesigner.BindingPreviewMode.SampleData)
The behaviour is not dependant on the card or sample data, the issue can be reproduced with any or no data.
Card JSON
{}
Screenshot
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the error in adaptivecard-designer-app by commenting out line 321 of app.ts, then activate preview mode without SampleData or New card initialization. Trace the template expansion path where the undefined value is read for dataType. Done means preview mode displays correctly with any or no card data and the browser console no longer logs the error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100