Search code examples
ember.jsember-cli

Ember js warning with three.js


What is the correct way to use Ember js with three.js. I have tried using it with cdn by editing the index.html file which works fine but i get warning in ember-cli about THREE not being defined. Also installing it with bower and using app.import gave me similar warnings.

The app works all fine but i wanted to know what is the best way to import in this case three.js into an ember application without the warnings.


Solution

  • That is a JSHint warning because it isn't aware of the global THREE variable you're trying to access. You have two ways to fix it:

    1. Put a globals directive at the top of the file that uses the variable.
    2. Setup .jshintrc's predef.

    Hope this helps!