Adaptivecards: [IE11][adaptivecards-templating ] [IE11 not working]

Created on 17 Aug 2020  路  5Comments  路  Source: microsoft/AdaptiveCards

Platform

  • JavaScript

Author or host

IE11

Version of SDK

"name": "adaptivecards-templating",
"version": "1.1.0",

Details

When using adaptive-cards-templating in IE11. It crashes with Accessing the 'caller' property of a function or arguments object is not allowed. Only happens when I import adaptive-cards-templating.

Also using the example https://github.com/microsoft/AdaptiveCards/blob/main/source/nodejs/adaptivecards-templating/example.html it seems not to work in IE11.

This is how i'm using adaptive-cards-templating.

`
import * as AdaptiveCards from 'adaptivecards';
import * as ACData from 'adaptivecards-templating';

function getAdaptiveCard({ schema, data = {}, hostConfig = {} }) {
const template = new ACData.Template(schema);

const card = template.expand({
    $root: data
});

const adaptiveCard = new AdaptiveCards.AdaptiveCard();

adaptiveCard.hostConfig = new AdaptiveCards.HostConfig(hostConfig);
adaptiveCard.parse(card);

return adaptiveCard.render();

}

export default getAdaptiveCard;
`

The thing is that if I don't import adaptive-cards-templating and it's not being used it works perfectly in IE11.

It works great on chrome.

Area-Templating Bug

All 5 comments

@dclaux any idea on this?

@cavr could you by any chance paste a picture of the IE debug console so I can see exactly what error occurs?

Yes of course.
image
image

I think that adaptive-expressions ("adaptive-expressions": "^4.9.2") it's not being transpile to es5. And that's why in IE we are having problems.

Ah - the problem actually comes from the Adaptive Expressions library which adaptivecards-templating depends on. AEL compiles to ES6 with no plan to change its target to ES5. Unfortunately that makes it (and by extension the adaptivecards-templating library) incompatible with/unsupported on IE11.

I am sorry, but I am afraid I don't have a solution here.

Ok @dclaux. Finally we are going to render the card on the server server side with the .net library.

Thanks you so much for your help.

Was this page helpful?
0 / 5 - 0 ratings