[ReferenceError] "ReferenceError: window is not defined" on [email protected]
Target Platforms
NodeJS
SDK Version
2.11.0
Application Name
Node console app
Problem Description
My project is a node backend app using adaptivecards to parse/render/verify card content on server side.
It was using [email protected] and everything worked well. After switching to the latest [email protected], it throws ReferenceError: window is not defined on require("adaptivecards").
ReferenceError: window is not defined
at Object.
Screenshots
Card JSON
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.4",
"body": [
]
}
Sample Code Language
javascript
Sample Code
const { AdaptiveCard } = require("adaptivecards"); // error occurs at this line
const card = require("./card.json"); const ac = new AdaptiveCard(); ac.parse(card);
Same for me when I try to run this sample repo code.
Going back to 2.10.0 fixed my issue.
https://github.com/OfficeDev/TeamsFx-Samples/tree/v1.0.0/bot-sso
node: 16.17.0 SDK: 2.11.0
Hey @swatDong - this has been fixed in 2.11.1! Please let us know if you encounter any further difficulties.