Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ractive-load.js not working when testing out your ractive-load js samples #32

Open
awongCM opened this issue Dec 12, 2015 · 5 comments
Open

Comments

@awongCM
Copy link

awongCM commented Dec 12, 2015

Hi,

I'm trying to learn and test out one of your code samples of using ractive-load plugin.

http://examples.ractivejs.org/donut-charts

I reproduced all the code on my local machine, ran python simpleHTTPserver as my own webserver, etc.

When I tried to viewing it in my web browser, i got following errors in the console log.

Uncaught (in promise) Error: Ractive.load() error: Could not find dependency "ractive-transitions-fade". It should be exposed as Ractive.load.modules["ractive-transitions-fade"] or window["ractive-transitions-fade"

Why is it complaining about the promises? Is it because I'm using a different web server than Node/Express?

In my JS code, I simply wrote code like this(as per your existing samples)

Ractive.load('BaseView.html').then(function (BaseView) {
   var ractive = new BaseView({
      el: 'main',
      data: getData()
    });  
});

function getData () {
  return {
    months: [
      { name: 'January',   points: { dogs: 4, cats: 3, rabbits: 7 } },
      { name: 'February',  points: { dogs: 2, cats: 7, rabbits: 3 } },
      { name: 'March',     points: { dogs: 5, cats: 4, rabbits: 6 } },
      { name: 'April',     points: { dogs: 6, cats: 8, rabbits: 4 } },
      { name: 'May',       points: { dogs: 8, cats: 9, rabbits: 5 } },
      { name: 'June',      points: { dogs: 3, cats: 2, rabbits: 2 } },
      { name: 'July',      points: { dogs: 4, cats: 4, rabbits: 8 } },
      { name: 'August',    points: { dogs: 2, cats: 5, rabbits: 9 } },
      { name: 'September', points: { dogs: 3, cats: 6, rabbits: 4 } },
      { name: 'October',   points: { dogs: 7, cats: 2, rabbits: 7 } },
      { name: 'November',  points: { dogs: 5, cats: 8, rabbits: 5 } },
      { name: 'December',  points: { dogs: 1, cats: 0, rabbits: 7 } }
    ]
  };
}
@fskreuz
Copy link
Contributor

fskreuz commented Dec 12, 2015

error: Could not find dependency "ractive-transitions-fade"

Check if that plugin exists, or is even loaded by the browser.

@awongCM
Copy link
Author

awongCM commented Dec 13, 2015

No. It doesn't.

@awongCM
Copy link
Author

awongCM commented Dec 16, 2015

Hi. Did you get my response?

@Madgvox
Copy link
Member

Madgvox commented Dec 16, 2015

Your problem is that ractive-load couldn't find the ractive-transitions-fade plugin. You need to either remove that dependency from the snippet or load it as well in a way that ractive-load can find. Here is the section of the readme that describes how that works.

@awongCM
Copy link
Author

awongCM commented Dec 22, 2015

Okay. Thanks.

I'll check out the readme section as soon as I have time to look at it.

Will let you know how it goes.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants