microsoft / microsoft/AdaptiveCards
[Rendering] adaptivecards-react should list swiper as dependency
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Target Platforms
NodeJS
SDK Version
adaptivecards-react v1.1.1
Application Name
Web app
Problem Description
Following the instructions of adaptivecards-react to render an adaptive card in an React app. Hit the following errors
Module not found: Error: Can't resolve 'swiper' in 'MY_APP_ROOT\webapp\node_modules\adaptivecards\lib'
ERROR in ./node_modules/adaptivecards/lib/carousel.js 51:15-32
Module not found: Error: Can't resolve 'swiper' in 'MY_APP_ROOT\webapp\node_modules\adaptivecards\lib'
After manually installing swiper from npm, the issue is resolved.
Per observation, adaptivecards-react has hard dependency on swiper which should be listed in the documentation. The following command should be npm install react adaptivecards-react swiper --save

Screenshots

Card JSON
var card = {
type: 'AdaptiveCard',
version: '1.0',
body: [
{
type: 'TextBlock',
text: 'Here is a ninja cat',
},
{
type: 'TextBlock',
text: 'Here is another ninja cat',
},
{
type: 'Image',
url: 'http://adaptivecards.io/content/cats/1.png',
},
],
};
Sample Code Language
Typescript
Sample Code
// ....
// test adaptive card
var card = {
type: 'AdaptiveCard',
version: '1.0',
body: [
{
type: 'TextBlock',
text: 'Here is a ninja cat',
},
{
type: 'TextBlock',
text: 'Here is another ninja cat',
},
{
type: 'Image',
url: 'http://adaptivecards.io/content/cats/1.png',
},
],
};
var hostConfig = {
fontFamily: 'Segoe UI, Helvetica Neue, sans-serif',
};
return (
<AdaptiveCard payload={card} hostConfig={hostConfig} />
);
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
Start by reviewing the adaptivecards-react npm README instructions and the dependency usage shown in adaptivecards/lib/carousel.js. Reproduce the documented React installation in a fresh app, then verify that the package metadata or installation instructions account for swiper so the sample renders without manually installing it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100