{"id":2846,"date":"2014-02-24T00:41:24","date_gmt":"2014-02-24T00:41:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/24\/how-to-get-started-with-yeoman-and-three-js-collection-of-common-programming-errors\/"},"modified":"2014-02-24T00:41:24","modified_gmt":"2014-02-24T00:41:24","slug":"how-to-get-started-with-yeoman-and-three-js-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/02\/24\/how-to-get-started-with-yeoman-and-three-js-collection-of-common-programming-errors\/","title":{"rendered":"How to get started with yeoman and three.js?-Collection of common programming errors"},"content":{"rendered":"<p>I installed threejs with bower install threejs<\/p>\n<p>Then after this I wish to have threejs in my page, so my app.js file starts with:<\/p>\n<pre><code>define([\"jquery\", \"three\"], function() {\n  \"use strict\";\n<\/code><\/pre>\n<p>However when my page loads the Chrome console shows<\/p>\n<pre><code>Failed to load resource: the server responded with a status of 404 (Not Found) http:\/\/localhost:9000\/scripts\/three.js\nUncaught Error: Script error\n<\/code><\/pre>\n<p>Well, shouldn&#8217;t it be looking in components like it does for JQuery?<\/p>\n<p>Basically how can I get started with yeoman and installing three.js?<\/p>\n<ol>\n<li>\n<p>Solution is as follows.<\/p>\n<p>The app.js file needs to refer to &#8220;three&#8221; as above and this refers to the file main.js which has the following.<\/p>\n<pre><code>require.config({\n    paths: {\n        jquery: '..\/components\/jquery\/jquery',\n        three: '..\/components\/threejs\/build\/three'\n    },\n    shim: {\n        bootstrap: {\n            deps: ['jquery'],\n            exports: 'jquery'\n        }\n    }\n});\n<\/code><\/pre>\n<p>The key here is the three which points where threejs three.js file is located.<\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>I installed threejs with bower install threejs Then after this I wish to have threejs in my page, so my app.js file starts with: define([&#8220;jquery&#8221;, &#8220;three&#8221;], function() { &#8220;use strict&#8221;; However when my page loads the Chrome console shows Failed to load resource: the server responded with a status of 404 (Not Found) http:\/\/localhost:9000\/scripts\/three.js Uncaught [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2846","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2846"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2846\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}