MeteorJS Iron Router installation crashing app - javascript

I have problem with my application, I'm learning with "Discover Meteor" book, but frankly I have an error that I don't know how to fix.
I'm right now at "Routing" chapter, and when I install iron-router package with
mrt add iron-router
my whole app just crushes and I don't know how to fix it.
Here are the errors:
TypeError: Template.__create__ is not a function
TypeError: Parent is undefined
TypeError: Iron.Layout is not a constructor
TypeError: Package['iron-router'] is undefined
ReferenceError: Template is not defined
ReferenceError: Template is not defined
ReferenceError: Template is not defined
ReferenceError: Template is not defined
ReferenceError: Template is not defined
ReferenceError: Meteor is not defined
ReferenceError: Meteor is not defined
Any ideas?

mrt add iron-router was deprecated
try with
meteor add iron:router instead

For template undefined error,
try run meteor reset command and then start server with meteor
Note: meteor reset will do reset your build and also local mongodb data
Update: It should remove the error but anyways try full uninstall of meteor from your system and install it again.
The meteor core installation might get corrupted while auto updating from 0.8 to 1.0 version
Uninstall meteor -
rm -rf ~/.meteor
rm -rf /usr/local/bin/meteor
Install
curl https://install.meteor.com/ | sh
Above will install latest version of meteor i.e 1.0
and after that now update your project with
cd <your-project-directory>
meteor update --release 1.0.0

Related

ember + Could not find module `#ember/application`

I have a ember app, after start server, log this error in console:
Error: Could not find module #ember/application imported from app
Make sure you are on ember/ember-cli version > 2.16 and using yarn with latest node preferably nodejs: 8.8.1, npm: 5.5.1.
Also, go through the deprecations to understand how and why ember has been upgraded from previous versions --> https://www.emberjs.com/deprecations/v2.x

Unable to build meteor app (Windows): \promise_server.js:116

More code posted here https://forums.meteor.com/t/major-node-issue-unable-to-build-meteor-app-windows-promise-server-js-116/26798/1
I get the following errors when I try to build or update an app:
When UPDATEing from 1.2.1 to any other version:
C:\Users\user1\AppData\Local\.meteor\packages\less\2.6.0\plugin.compileLessBatch.os\npm\node_modules\meteor\promise\node_modules\meteor-promise\promise_server.js:116
throw error;
^
Error: ENOTDIR, readdir '<projectDirectory>\.meteor\local\isopacks\.build994576.ccbanker_template-banker\web.browser\client\js\settings\.builder-tmp-file.264146'
When BUILDing an app - which is meteor 1.3.5.1
C:\Users\user2\AppData\Local\.meteor\packages\templating\1.1.9\plugin.compileTemplatesBatch.os\npm\node_modules\meteor\promise\node_modules\meteor-promise\promise_server.js:116
throw error;
^
TypeError: Cannot call method 'split' of undefined
I also get a similar error when I create a new empty app, and then try to BUILD it (which succeeds) and NPM INSTALL (which fails, again throwing the error at promise_server.js:116)
Have tried rebuilding all of this on a clean install of node+npm+meteor.
Node version 0.10.40 require for npm build in meteor js.
You can use nvm for node version change: https://github.com/creationix/nvm

Ember Engine Uncaught Error: Could not find module ember-views/views/select

Created new app with
ember new app-name
version: 1.13.13
node: 5.5.0
npm: 2.14.10
os: linux x64
After running
"ember s"
App works proper in browser
As per guide at https://github.com/dgeb/ember-engines for running ember engine ran below command
ember install ember-engines
rm -rf bower_components
bower install --save ember#canary #Choosed ember#canary from prompt
bower install
And now when i do "ember s" app gets compile properly in CLI but app gets crash in browser and i see nothing in browser.
In console i see below error message
Uncaught Error: Could not find module ember-views/views/select
Tried debugging it, Could not find solution. Is i am missing somthig basic here ?
Note :: I am new to ember. I think this would be small one but could not find solution on web as well.
Sorry about that! There were a few commits/fixes on master that hadn't been released yet.
I just released v0.2.1 which should clear this up for you.

Getting "Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1" with app created through ember-cli

I'm starting with ember. I followed the Getting Started guide at emberjs.com and managed to create a new ember application by running the following commands:
npm install -g ember-cli
ember new sample-app
Everything went successful and I can see the app files generated by ember-cli. Soon after that I did:
ember server
The command line shows:
version: 1.13.13
Livereload server on http://localhost:49153
Serving on http://localhost:4200/
Build successful - 4426ms.
Slowest Trees | Total
----------------------------------------------+---------------------
ConcatWithMaps: Concat: Vendor | 3498ms
Slowest Trees (cumulative) | Total (avg)
----------------------------------------------+---------------------
ConcatWithMaps: Concat: Vendor (1) | 3498ms
The problem comes when I go to http://localhost:4200. Nothing gets loaded and the Chrome console is showing the following:
Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1
Uncaught Error: Could not find module `ember` imported from `sample-app/app`
I tried to fix this by reinstalling ember-cli, bower and npm but nothing is working.
Here's additional info in case is necessary:
$ ember -v
version: 1.13.13
node: 5.4.0
npm: 2.14.10
os: darwin x64
$ npm -v
3.5.3
$ bower -v
1.7.2
Help is much appreciated. Thanks in advance!
This is a bug due to a new version of jQuery which ember is not yet able to handle. For now you can change the following line in your bower.json file. Then run bower install and it should work.
"jquery": "^1.11.3",
to
"jquery": "1.11.3",
A new version of ember.js is imminent which should fix this.

"Uncaught ReferenceError: Template is not defined" (same for Router, Meteor, Mongo)

Trying to port Crowducate from Meteor 0.8 to 1.0. I ran "meteor update".
Branch for Meteor 1.0 is --> here.
I had update-issues, i.e. I couldn't remove the "old" iron-router for the "new" iron:router. So currently, both versions are installed (this has to change, of course). Meteor package file:
# Meteor packages used by this project, one per line.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
# Packages by Meteor
standard-app-packages
preserve-inputs
audit-argument-checks
spiderable
less
coffeescript
accounts-password
accounts-facebook
accounts-google
accounts-ui
# Packages by community
minimongoid
iron-router
iron:router
kaptron:minimongoid
# Packages by Manuel Schoebel
Running meteor: Gives the following error:
In the end, I also get the following error:
Exception in defer callback: TypeError: Cannot read property 'insert' of undefined
at Utils.extend.autoRender (http://localhost:3000/packages/iron-router.js?af9f4791b8af4582a37d93bcade1eed163a976a8:1636:17)
at http://localhost:3000/packages/iron-router.js?af9f4791b8af4582a37d93bcade1eed163a976a8:1465:16
at _.extend.withValue (http://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:945:17)
at http://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:430:45
at Object.<anonymous> (http://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:973:22)
at onGlobalMessage (http://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:367:23)
So most things are undefined. I also locally changed Meteor.Collection to Mongo.Collection. Now, both are undefined.
Thanks for trying to help out,
Amir
Side note: Always looking for collaborators on this project. Contact me. :)
I also had these errors given I had installed Iron Router via meteorite:
$ mrt add iron-router
This installed an older version which is incompatible with Meteor 1.x.
Try removing iron-router via meteorite and installing via meteor:
$ mrt remove iron-router
$ meteor add iron:router
Just to be safe run reset before relaunching:
$ meteor reset
$ meteor
I just had the same problem. I tried following #Jason's instructions but kept getting:
error: unknown package in top-level dependencies: iron-router
when I tried to install iron:router. Thanks to this thread I finally got the issue resolved by removing iron-router from .meteor/packages. Apparently mrt remove iron-router doesn't completely remove all traces of iron-router.
For template undefined error,
try run meteor reset command and then start server with meteor
Note: meteor reset will do reset your build and also local mongodb data
Update: It should remove the error but anyways try full uninstall of meteor from your system and install it again.
The meteor core installation might get corrupted while auto updating from 0.8 to 1.0 version
Uninstall meteor -
rm -rf ~/.meteor
rm -rf /usr/local/bin/meteor
Install
curl https://install.meteor.com/ | sh
Above will install latest version of meteor i.e 1.0
and after that now update your project with
cd <your-project-directory>
meteor update --release 1.0.0
this worked for me:
meteor remove iron-router

Categories

Resources