justinwilaby / babel-plugin-jsx-adaptive-cards

A Babel plugin to transpile JSX to Adaptive Cards
MIT License
9 stars 0 forks source link

Error on require of .acx #2

Open thecouchcoder opened 6 years ago

thecouchcoder commented 6 years ago

I am unsure how to use the card that is produced by this plugin.

In my index.js file I first tried to use

const acx = require ('./BasicCard.acx') similar to this example

However I get a syntax error saying it is an unexpected token.
If I remove that require statement and just print the output of babel.transform of the .acx file the card looks fine. This lead me to believe the .acx file is not getting transpiled on require.

I thought perhaps I needed to include the transpiled file so I changed the require to const acx = require("./test/test.js");

However I get an error "can't find module "../schema".

I am very unfamiliar with babel, so it's likely I have something setup wrong, but I am not sure.

Any help would be appreciated. https://github.com/aes421/AdaptiveCardTest

thecouchcoder commented 6 years ago

Since I forgot to include it int he original post: I will be using this card with Microsoft's bot builder framework to make a chatbot for Cortana. I'd like it be able to call something similar to

const card = new BasicCard()
card.render() 

to create the card.

justinwilaby commented 6 years ago

I'll look into this. Have you tried looking at the unit tests for some ideas on what might be going wrong?