microsoft / microsoft/AdaptiveCards

[Designer] Template expansion error: Cannot read properties of undefined (reading 'dataType') activating preview mode

Open
#8,039 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Designer Bug
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 card dialog

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.