Meteor and conversational form

#1

Hey,

I want to use the conversational-form framework within my meteor application, but I’m having trouble.

First of all, there seems to be a bug with the export function in the npm-package, which makes it impossible to adjust any options. Since it works fine in a normal html-project, I wondered if there was any way around by just using the script link? Doing so either didn’t work at all for me or ended up with meteor asking for the package.

Second, I want to overwrite some styles, but the conversational form stylesheet always always gets loaded last (triggered by the package/script, not included by me). Any way around this? I’ve tried everything I found online or on the forum, nothing worked.
I guess it’s the same problem that I can’t set options for the form (due to the issues described above), because there I could set “loadExternalStylesheet” to false.

#2

What library are you using on the front-end? Blaze?

How are you including / activating conversational-form? Is it giving you any errors?


EDIT: I just took a quick look at their code, and their UMD pattern has some issues, so that could be it?

should be fine to just use the script link instead

#3

@coagmano yes, using Blaze on frontend.

At the moment I have created a script where I import the package and set up my options. This is then imported in the client/main.js.

The behaviour is really weird: like I said, the bot conversation is created, and some options are applied (e.g. robotResponseTime), but others obviously aren’t and I get warnings such as:

Conversational Form Dictionary warning, ‘user-image’ value is undefined, mapping ‘user-image’ to default value. See Dictionary.ts for keys.

even though I do define a user image in my options. Otherwise no errors at the moment, but once, when I tried to create an event dispatcher, I got

cf.EventDispatcher is not a constructor

(and none of the warnings).

Also, fieldset for radio buttons doesn’t work (combining all of the buttons together, even if they belong to different questions).

Including the script link somehow didn’t work for me, either it didn’t set up a form at all (leaving the space empty - when using the package, it does create a chatbot conversation, but the buggy one) or meteor kept asking me for the missing npm package.

How and where would you include the script? Maybe I am missing something?

#4

@baobas I am using Blaze on the frontend too. I was able to render it by putting $("head").append( '<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@0.9.80/dist/conversational-form.min.js" crossorigin></script>' ); inside Meteor.startup(function() {.