javascript - Meteor Reference Error -


i'm new programming , hoping if me figure out problem app. here link repo in github.

the error:

w202306-18:14:53.145(-4)? (stderr) /users/ed/apptest/.meteor/local/build/programs/server/boot.js:184 w202306-18:14:53.146(-4)? (stderr) }).run(); w202306-18:14:53.146(-4)? (stderr)    ^ w202306-18:14:53.147(-4)? (stderr) referenceerror: require not defined w202306-18:14:53.148(-4)? (stderr)     @ app/node_modules/stripe/test/charges.js:1:47 w202306-18:14:53.148(-4)? (stderr)     @ app/node_modules/stripe/test/charges.js:65:3 w202306-18:14:53.149(-4)? (stderr)     @ mains (/users/ed/apptest/.meteor/local/build/programs/server/boot.js:153:10) w202306-18:14:53.149(-4)? (stderr)     @ array.foreach (native) w202306-18:14:53.149(-4)? (stderr)     @ function._.each._.foreach (/users/ed/.meteor/tools/3cba50c44a/lib/node_modules/underscore/underscore.js:79:11) w202306-18:14:53.150(-4)? (stderr)     @ /users/ed/apptest/.meteor/local/build/programs/server/boot.js:80:5 => exited code: 1 => application crashing. waiting file change. 

there number of issues related application folder structure , use of packages in meteor.

1.) app structure: default every file in project meteor attempt load both client , server side. if want separate files client , server need use put them in client , server folders. there other key folder names meteor looks out packages, lib etc. these explained in 'structuring app' section of meteor docs: http://docs.meteor.com

the problems have jquery plugin , stripe module in project root when server side code looks @ jquery doesn't know , when client looks @ stripe module's code written node.js app doesn't know how handle it.

now have 'client' folder found out when looking @ problem, meteor picky , requires undercase. first of rename client folder client. next move jquery-jplayer folder inside client folder. lastly suggest making server folder , moving node module there instead i'll suggest better way...

2.) using packages meteor: standard node.js app 'npm install module-name'. in meteor packages tend handled differently. first of instead of doing npm install can request package server side doing npm.require('module-name'); secondly packages have standard way of being made explained in 'writing packages' of meteor docs. i'll save details , explain how stripe working in app.

luckily else has created stripe package meteor. standard packages bundled meteor backbone, accounts etc. there repository of packages made community members. install these packages need install command line tool called meteorite. details explained here: https://atmosphere.meteor.com/wtf/app . install stripe package made tyler johnson (https://atmosphere.meteor.com/package/stripe) 'mrt add stripe' project's root directory. next delete node_modules folder have. on run meteor app type 'mrt' in command line instead of 'meteor', required because use meteorite packages in app, future apps don't make use of meteorite packages can continue using 'meteor'

other minor errors:

  • on line 11 mymusicapp.html reference template name {{> playlist}} instead of playlists
  • on line 32 mymusicapp.js invoke jplayer $("#jquery_jplayer_1").jplayer({... have use capital p i.e. $("#jquery_jplayer_1").jplayer (you find out in programming stuff specific when comes capital letters or lack of)
  • the last errors come events in mymusicapp.js, okcancelevents stuff. i'm not sure trying in bit, mousedown, click , dblclick events above fine.

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -