After I updated my Meteor app to 0.6.5 using
meteor update
and deployed it to my shared server (webfaction). I have a new error that appeared without me changing the application :
/home/me/webapps/meteor/bundle/programs/server/boot.js:184
}).run();
^
Error: a route URL prefix must begin with a slash
at _.extend.declare (packages/routepolicy/routepolicy.js:95)
at new StreamServer (packages/livedata/stream_server.js:23)
at new Server (packages/livedata/livedata_server.js:1029)
at Package (packages/livedata/server_convenience.js:10)
at packages/livedata.js:3907:4
at packages/livedata.js:3918:3
at /home/me/webapps/meteor/bundle/programs/server/boot.js:153:10
at Array.forEach (native)
at Function._.each._.forEach (/home/me/webapps/meteor/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
at /home/me/webapps/meteor/bundle/programs/server/boot.js:80:5
Downgrading to 0.6.4.1 fixes the issue.
I would very much like to understand why the error is coming with 0.6.5
Check your ROOT_URL. Make sure it starts with http://
It might have something to do with changes to the package API in 0.6.5. See the release notes - http://www.meteor.com/blog/2013/08/14/meteor-065-namespacing-modularity-new-build-system-source-maps
And this meteor-talk thread - https://groups.google.com/d/topic/meteor-talk/BbrjGcGGIzc/discussion
Related
I am trying to login Facebook with Firebase. I have installed all the libraries required and completed the required configuration. Still, whenever I try to start my app it is giving me this error:
(node:11160) UnhandledPromiseRejectionWarning: TypeError: Cannot read
property 'manifest' of undefined
at removeOldOptions (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova- universal-links-plugin\hooks\lib\android\manifestWriter.js:48:32)ished in 37.33 s
at Object.writePreferences
(C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-
plugin\hooks\lib\android\manifestWriter.js:27:19)
at activateUniversalLinksInAndroid
(C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:65:25)
at C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:45:11
at Array.forEach (<anonymous>)
at run (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:41:17)
at module.exports (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:18:3)
at runScriptViaModuleLoader (C:\Users\Dell\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:188:18)
at runScript (C:\Users\Dell\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:164:16)
(node:11160) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Able to solve this with below changes :
Just go to the below file in Ionic
plugins/cordova-universal-links-plugin/hooks/lib/android/manifestWriter.js
I fixed issue by changing pathToManifest as below:
var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'cordovaLib', 'AndroidManifest.xml');
to
var pathToManifest = path.join(
cordovaContext.opts.projectRoot,
'platforms',
'android',
'app',
'src',
'main',
'AndroidManifest.xml');
For anyone that's looking into this these days, the actual fix for this was published by someone which you can pull in as a cordova plugin https://github.com/nordnet/cordova-universal-links-plugin/issues/133#issuecomment-369260863
#okaufmann you can use the changed version of the plugin. since it's not merged in the nordnet repository, you must remove the plugin and install again using:
cordova plugin add https://github.com/walteram/cordova-universal-links-plugin
After doing...
cordova plugin rm cordova-universal-links-plugin
cordova plugin add https://github.com/walteram/cordova-universal-links-plugin
.. my project was able to build successfully.
You need to update the AndroidManifest path in the plugin, which seems to be outdated. Check out this:
https://github.com/nordnet/cordova-universal-links-plugin/issues/146
So I've done the todo and leaderboard tutorials and now am excited to begin routing - seems like iron router is the way to go so I install it to my project using
mrt add iron-router
Seems to install ok so I start meteor and navigate to localhost:3000 and my console lights up with:
Uncaught TypeError: undefined is not a function
helpers.js:141 Uncaught TypeError: Cannot read property 'prototype' of undefined
router.js:61 Uncaught TypeError: undefined is not a function
global-imports.js?784bc180a149e4c10dff977a7f114df67d9952c6:3 Uncaught TypeError: Cannot read property 'RouteController' of undefined
template.tutorialexample.js?e119ff8df948cfe8167f49eb28794995a594841c:2 Uncaught ReferenceError: Template is not defined
tutorialexample.js?a4ef596255404350be2cc45303caea02f934cd17:1 Uncaught ReferenceError: Meteor is not defined
Mind you this is a default app, haven't touched a thing.
So if someone could point me in the right direction that would be great. I did read somewhere that I should be using 0.8.2 version of iron router - and I then did change my smart.json file to contain:
{
"packages": {
"iron-router": "0.8.2"
}
}
and then did meteor update etc but still no luck. So any help anyone could provide would be great.
Meteor has changed quite a bit & the instructions/tutorial you've been following is a bit dated.
Previously mrt was part of the meteorite packaging system, from Meteor 0.9.0 it has been integrated directly into meteor.
So now you do:
meteor add iron:router
To add it to your project. Once you start your app up it should present a basic template on how to use it.
I am a Meteor newbie and just ran into a problem using accounts-google (see below). All I did was follow the instructions on http://docs.meteor.com/#meteor_loginwithexternalservice. Any ideas on how to solve this issue and get Google login working? Thanks!
Terminal output:
W20141003-09:42:57.115(7)? (STDERR)
W20141003-09:42:57.116(7)? (STDERR) /Users/aw/.meteor/packages/meteor-tool/.1.0.33.alt9dq++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
W20141003-09:42:57.116(7)? (STDERR) throw(ex);
W20141003-09:42:57.117(7)? (STDERR) ^
W20141003-09:42:57.118(7)? (STDERR) ReferenceError: ServiceConfiguration is not defined
W20141003-09:42:57.119(7)? (STDERR) at app/server/accounts.js:26:1
W20141003-09:42:57.120(7)? (STDERR) at app/server/accounts.js:35:3
W20141003-09:42:57.120(7)? (STDERR) at /Users/aw/TS/.meteor/local/build/programs/server/boot.js:168:10
W20141003-09:42:57.120(7)? (STDERR) at Array.forEach (native)
W20141003-09:42:57.121(7)? (STDERR) at Function._.each._.forEach (/Users/aw/.meteor/packages/meteor-tool/.1.0.33.alt9dq++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
W20141003-09:42:57.121(7)? (STDERR) at /Users/aw/TS/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8
When I comment out my service configuration code (below)
// first, remove configuration entry in case service is already configured
ServiceConfiguration.configurations.remove({
service: "google"
});
ServiceConfiguration.configurations.insert({
service: "google",
clientId: "xxxxxxxx",
secret: "xxxxxxxxx"
});
It asks me to enter the clientId and secret from the bootstrap dropdown gui. Then nothing happens after that.
After I add service-configuration, I get the following error after logging in:
It turns out that in addition to meteor add service-configuration, you have to complete a minimum of all of the following in Google's API website:
https://console.developers.google.com/project
"Create Project"
Wait for the project to be provisioned
"API & auth" on the sidebar, "Credentials"
"Create new Client ID"
Paste in "Authorized JavaScript origin" and "Authorized Redirect URI"
"Create Client ID"
Copy the Client Secret and Client ID to your app configuration
"API & auth" on the sidebar "Consent screen"
Enter the field "Product Name" and save
Steps 9 & 10 appear to be new requirements from Google in the past few days. See this Github ticket regarding the issue.
You need to meteor add service-configuration manually.
The rest of your code looks good to me.
You also need to make sure that you configured things correctly in the Google Developers Console.
Add http://localhost:3000/_oauth/google?close in the REDIRECT URIS section, as well as http://localhost:3000/ for the JAVASCRIPT ORIGINS section.
This is for testing purpose on localhost, you'll need to add your deployed app actual ROOT_URL (http://www.example.com/) when pushing to production.
I addressed a similar problem here :
Meteor.user is null after (apparently) successful login
Since I updated meteor to 0.8.3 I'm getting following error.
ReferenceError: Spacebars is not defined
at Package (packages/compiler/compiler.js:2)
at /home/cis/work/meteor/heber/zzbase-meteor/.meteor/local/build/programs/server/packages/comp
at /home/cis/work/meteor/heber/zzbase-meteor/.meteor/local/build/programs/server/packages/comp
at /home/cis/work/meteor/heber/zzbase-meteor/.meteor/local/build/programs/server/boot.js:161:1
at Array.forEach (native)
at Function._.each._.forEach (/home/cis/.meteor/tools/cef2bcd356/lib/node_modules/underscore/u
at /home/cis/work/meteor/heber/zzbase-meteor/.meteor/local/build/programs/server/boot.js:82:5
I have following packages:
accounts-ui , accounts-google, bootstrap-3, email, standard-app-packages, d3, compiler,
amplify, ace, blaze-layout, iron-router, backbone
Please help me, I'm stuck in last 5 days. :(
go to your project dir, and try running mrt update
Had the same problem. Ended up doing a new meteor create then did all the required mrt adds... copied the folders there. I saw a post on the Google Group suggesting removing everything in the /packages folder then running mrt update.
Can anyone tell me why the code below throws the following error? :
Error: A method named '/players/insert' is already defined
I'm new to Meteor and coffeescript so I may be overlooking something simple.
Here's my port of the leaderboard example to coffeescript:
###
Set up a collection to contain player information. On the server,
it is backed by a MongoDB collection named "players."
###
Players = new Meteor.Collection("players")
if Meteor.is_client
Template.leaderboard.players = ->
Players.find({}, {sort: {score: -1, name: 1}})
Template.leaderboard.selected_name = ->
player = Players.findOne(Session.get "selected_player")
player and player.name
Template.player.selected = -> if Session.equals("selected_player", this._id) then "selected" else ''
Template.leaderboard.events = {
'click input.inc': ->
Players.update(Session.get("selected_player"), {$inc: {score: 5}})
}
Template.player.events = {
'click': ->
Session.set("selected_player", this._id)
}
# On server startup, create some players if the database is empty.
if Meteor.is_server
Meteor.startup ->
if Players.find().count() is 0
names = [
"Ada Lovelace"
"Grace Hopper"
"Marie Curie"
"Carl Friedrich Gauss"
"Nikola Tesla"
"Claude Shannon"
]
Players.insert({name: name, score: Math.floor(Math.random()*10)*5}) for name in names
The full stack trace is as follows:
[[[[[ ~/dev/meteor/leaderboard ]]]]]
Running on: http://localhost:3000/
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: A method named '/players/insert' is already defined
at app/packages/livedata/livedata_server.js:744:15
at Function.<anonymous> (app/packages/underscore/underscore.js:84:24)
at [object Object].methods (app/packages/livedata/livedata_server.js:742:7)
at new <anonymous> (app/packages/mongo-livedata/collection.js:111:13)
at app/leaderboard.js:4:11
at /Users/alex/dev/meteor/leaderboard/.meteor/local/build/server/server.js:109:21
at Array.forEach (native)
at Function.<anonymous> (/Users/alex/dev/meteor/leaderboard/.meteor/local/build/server/underscore.js:76:11)
at /Users/alex/dev/meteor/leaderboard/.meteor/local/build/server/server.js:95:7
Exited with code: 1
I'm running Meteor version 0.4.0 (8f4045c1b9)
Thanks in advance for assistance!
You would also get this error, regardless of using coffeescript or plain javascript, if you duplicated your files. For example, copying your sources files to a subdirectory named Backup would produce this error, because Meteor merges files from subdirectories.
This appears to be a configuration issue with coffeelint (installed globally with npm).
I originally installed coffeelint to check that my coffeescript code was correct and had no errors.
I installed coffeelint as per the instructions with:
sudo npm install -g coffeelint
coffeelint worked fine when run stand-alone against .coffee files.
However, when running any Meteor project with coffeescript package added I got the above error.
On a whim, I thought the error might be due to conflict with my exisiting node install.
I decided to uninstall coffeelint first with:
sudo npm uninstall -g coffeelint
and then deleted the previously meteor-generated leaderboard.js file.
After re-starting meteor the coffeescript example above worked as expected without errors.
try moving (ie copying and deleting the original )
Players = new Meteor.Collection("players")
one time below if Meteor.is_client
and another time below if Meteor.is_server
I don't know exactly why, as I'm new to Meteor too, but that worked for me, I assume that the server side needs it's own reference,as well as the client,
although declaring outside the scope should do the same (maybe a bug, remember they're still at 0.5.0 preview , which makes me think you might wanna upgrade and try some new smart packages that are with the new version, it looks like you're using 0.4), but when the files in my server wouldn't recognize anything I defined the root directory of meteor (which pushes these files to both client and server), I defined the server's own reference, and I got the same error, and until I moved the 'public' declaration of the reference to give the server and the client each their own copy, nothing worked.
Hopefully that helps...