Meteor Server unable to locate `findUserByEmail` - meteor

Running latest version of Meteor. I have added the accounts-password package but it seems Meteor server cannot detect any of the methods defined in it, specifically while accessing Accounts.findUserByEmail and Accounts.findUserByUsername.
All methods on the client side work as expected though.
This issue has been raised in the Meteor forums as well, but no one has been able to solve or troubleshoot this.
I have the following packages installed-
accounts-password 1.1.1* Password support for accounts
accounts-twitter 1.0.4* Login service for Twitter accounts
accounts-ui 1.1.5* Simple templates to add login widgets to an app
kadira:react-layout 1.2.0* Layout Manager for React with SSR Support
meteor-platform 1.2.2* Include a standard set of Meteor packages in your app
meteorhacks:flow-router 1.18.0* Carefully Designed Client Side Router for Meteor
meteorhacks:kadira 2.23.1* Performance Monitoring for Meteor
npm-container 1.2.0+ Contains all your npm dependencies
react 0.1.10* Everything you need to use React with Meteor.
service-configuration 1.0.4* Manage the configuration for third-party services
twitter 1.1.4* Twitter OAuth flow
underscore 1.0.3* Collection of small helpers: _.map, _.each, ...
Here is my Meteor versions file:
accounts-base#1.2.0
accounts-oauth#1.1.5
accounts-password#1.1.1
accounts-twitter#1.0.4
accounts-ui#1.1.5
accounts-ui-unstyled#1.1.7
autoupdate#1.2.1
babel-compiler#5.6.15
babel-runtime#0.1.3
base64#1.0.3
binary-heap#1.0.3
blaze#2.1.2
blaze-tools#1.0.3
boilerplate-generator#1.0.3
callback-hook#1.0.3
check#1.0.5
coffeescript#1.0.6
cosmos:browserify#0.4.0
ddp#1.1.0
deps#1.0.7
ejson#1.0.6
email#1.0.6
fastclick#1.0.3
geojson-utils#1.0.3
html-tools#1.0.4
htmljs#1.0.4
http#1.1.0
id-map#1.0.3
jquery#1.11.3_2
json#1.0.3
jsx#0.1.6
kadira:react-layout#1.2.0
launch-screen#1.0.2
less#1.0.14
livedata#1.0.13
localstorage#1.0.3
logging#1.0.7
meteor#1.1.6
meteor-platform#1.2.2
meteorhacks:flow-router#1.18.0
meteorhacks:kadira#2.23.1
meteorhacks:meteorx#1.3.1
minifiers#1.1.5
minimongo#1.0.8
mobile-status-bar#1.0.3
mongo#1.1.0
mongo-livedata#1.0.8
npm-bcrypt#0.7.8_2
npm-container#1.2.0
oauth#1.1.4
oauth1#1.1.4
observe-sequence#1.0.6
ordered-dict#1.0.3
random#1.0.3
react#0.1.10
react-meteor-data#0.1.6
react-runtime#0.13.3_6
react-runtime-dev#0.13.3_5
react-runtime-prod#0.13.3_4
reactive-dict#1.1.0
reactive-var#1.0.5
reload#1.1.3
retry#1.0.3
routepolicy#1.0.5
service-configuration#1.0.4
session#1.1.0
sha#1.0.3
spacebars#1.0.6
spacebars-compiler#1.0.6
srp#1.0.3
templating#1.1.1
tracker#1.0.7
twitter#1.1.4
ui#1.0.6
underscore#1.0.3
url#1.0.4
webapp#1.2.0
webapp-hashing#1.0.3
Any help is appreciated.

Related

Integrating Apollo to meteor app

When I'm trying to integrate an apollo server to a meteor app I get errors as soon as I try to open graphiql. If I create an express app and connect it with webapp.connectHandlers, and put apollo server to one of that express app's routes, thing work, but they don't work in "meteor way", which I would really like to have, since I would get access to the user object, authorization etc.
Error, which I see in graphiql as soon as it loads:
Error: Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory
stacktrace:
at invariant (/Users/.../node_modules/graphql/jsutils/invariant.js:18:11)<br> at Object.validate (/Users/.../node_modules/graphql/validation/validate.js:59:72)<br> at doRunQuery (/Users/.../node_modules/apollo-server-core/dist/runQuery.js:88:38)<br> at /Users/.../node_modules/apollo-server-core/dist/runQuery.js:22:54<br> at /Users/.../.meteor/packages/promise/.0.10.0.borizy.o9z8++os+web.browser+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
server code:
import {makeExecutableSchema} from 'graphql-tools';
import {typeDefs} from './schema';
import {resolvers} from './resolvers';
import { createApolloServer } from 'meteor/apollo';
export const schema = makeExecutableSchema({
typeDefs,
resolvers
});
createApolloServer({
schema
});
Everything seems legit and works with express, but not with meteor. What is the reason? How can I fix it?
The current version of meteor/apollo is out of date with the latest apollo npm packages. https://github.com/Swydo/ddp-apollo is up-to-date and does the integration in a "meteor way" 😊
Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory
If this is the problem, it would be solved by
rm -rf node_modules/*
npm install

Meteor app can't find routes

New to meteor. Just cloned a git repo, and upon launching the app, I get a router.js:347 There is no route for the path: / error.
This is my route for root in imports/startup/client/routes.js
FlowRouter.route('/', {
name: 'Home',
action() {
BlazeLayout.render('app_body', {tabs: 'tabs', inbox: 'inbox', upload: 'upload', invite: 'invite'});
console.log('root loaded');
},
});
Here is the list of packages
accounts-facebook 1.0.10 Login service for Facebook accounts
accounts-password 1.2.14* Password support for accounts
alanning:roles 1.2.15 Authorization package for Meteor
aldeed:collection2 2.9.1 Automatic validation of insert and update operations on the client and server.
aldeed:simple-schema 1.5.3 A simple schema validation object with reactivity. Used by collection2 and autoform.
arillo:flow-router-helpers 0.5.2 Template helpers for flow-router
blaze-html-templates 1.0.4 Compile HTML templates into reactive UI with Meteor Blaze
check 1.2.3 Check whether a value matches a pattern
dburles:collection-helpers 1.0.4 Transform your collections with helpers that you define
ecmascript 0.5.7* Compiler plugin that supports ES2015+ in all .js files
email 1.1.16* Send email messages
es5-shim 4.6.13* Shims and polyfills to improve ECMAScript 5 support
hpx7:youtube-iframe-player 0.4.15 Control YouTube's embedded player using Meteor
http 1.2.8* Make HTTP calls to remote servers
jazeee:spiderable-longer-timeout 1.2.13 Extended spiderable package: SSL, caching, longer timeout, no stdin issues, publish flag
jchristman:tagsinput-autocomplete-edited 1.1.0+ A combination of the mizzao:autocomplete library and a tagsinput-like functionality
jquery 1.11.9 Manipulate the DOM using CSS selectors
kadira:blaze-layout 2.3.0 Layout Manager for Blaze (works well with FlowRouter)
kadira:flow-router 2.12.1 Carefully Designed Client Side Router for Meteor
keepnox:perfect-scrollbar 0.6.8 Perfect-scrollbar packaged for meteor
manuel:reactivearray 1.0.5 Reactive Array for Meteor
matb33:collection-hooks 0.8.3* Extends Mongo.Collection with before/after hooks for insert/update/remove/find/findOne
meteor-base 1.0.4 Packages that every Meteor app needs
meteorhacks:aggregate 1.3.0 Proper MongoDB aggregations support for Meteor
mobile-experience 1.0.4 Packages for a great mobile user experience
momentjs:moment 2.14.4 Moment.js (official): parse, validate, manipulate, and display dates - official Meteor packaging
mongo 1.1.10* Adaptor for using MongoDB and Minimongo over DDP
reactive-dict 1.1.8 Reactive dictionary
reactive-var 1.0.10 Reactive variable
sacha:spin 2.3.1 Simple spinner package for Meteor
saucecode:timezoned-synced-cron 1.2.11 Fork of original w/ timezone support. Define and run scheduled jobs across multiple servers.
session 1.1.6 Session variable
spiderable 1.0.13 Makes the application crawlable to web spiders
standard-minifier-css 1.1.8* Standard css minifier used with Meteor apps by default.
standard-minifier-js 1.1.8* Standard javascript minifiers used with Meteor apps by default.
tomwasd:flow-router-seo 0.0.3 A simple way to set the title and meta tags for sites using flow router
tracker 1.1.0 Dependency tracker to allow reactive callbacks
twbs:bootstrap 3.3.6 The most popular front-end framework for developing responsive, mobile first projects on the web.
What is it that is causing the app not to find the routes file? I have looked through the following posts for some guidance, but have found none.
Meteor Routing Error : There is no route for the path: /
https://github.com/kadirahq/flow-router/issues/608
https://github.com/kadirahq/flow-router/issues/185
http://coderchronicles.org/2016/04/08/getting-started-with-meteor-1-3-react-and-flowrouter/
Any help solving the problem would be appreciated. I feel like I'm missing something simple.
-S
**project file structure
imports/
startup/
client/
index.js
routes.js
server/
fixtures.js
index.js
api/
server/
publications.js
ui/
components/
layouts/
pages/
client/
main.js
head.js
main.js
server/
main.js
fixtures.js
server-global.js
Are you importing the routes file into your app's main container?
For example, if you have a /client/main.js file that gets loaded from client side at startup, then it should include the import reference to routes file as follows:
import '/imports/startup/client';
Or, import '/imports/startup/client/routes.js';
Put your route file in 'imports/starup/lib' (lib - for example). In fast-render package recommended use 'lib', if you wanna use it. If no - 'client';
Then make sure you imported your route file in 'root/client/main.js';
Please, read this part of docs: https://guide.meteor.com/structure.html#javascript-structure
It is very helpful article.
UPD:
Please, remove duplicate files in your client/main.js
When, in client/main.js
import '/imports/startup/client';
In your imports/startup/client/index.js
import './routes.js';
And now it will work.
Dont forget, you must import all views you wanna use in your route.
Problem fixed. Instead of launching with meteor run, need to launch with meteor --settings settings.json --production

How to upgrade new Firebase app from exist old app?

There are "create new app" or "import from google project" only in new Firebase console.( https://console.firebase.google.com/ )
How to update exit old app to new one?( https://www.firebase.com/account/#/ )
---Edit
This issue looks like already fixed.
I think the cause is 500 request error on new Firebase console.
However it had fixed already.
If you are already signed in to the new Firebase Console with the same Google account as you used on firebase.com, then you should see your firebase.com project listed under "Projects currently at Firebase.com".
Follow the instructions on the new Firebase upgrade page for Web, Android or iOS.
I've had a somewhat similar problem. I see the import button but when I click it, and select the project I want to load, it only displays the spinner. Ive even tried to import JSON from an old firebase project (before the upgrades) and it just spins. Could it be that the old JSON is not what the new firebase is expecting?
EDIT
OK, seems it doesn't like Chrome. Works in IE 11 but not Chrome 50.0.2
This is how you update a Firebase < 3.0 app to Firebase 3.
Step 1
Install Regular Firebase - pod 'Firebase', '>= 2.5.1'
Or
If considering your old app is already Firebase < 3.0 you should be fine.
Step 2
Update - pod update
*At this point it will take a good couple minutes to update. You should see something like this.
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing Firebase 3.2.0 (was 3.2.0)
Using FirebaseAnalytics (3.2.0)
Installing FirebaseAuth (3.0.2)
Using FirebaseDatabase (3.0.1)
Using FirebaseInstanceID (1.0.6)
Using GoogleInterchangeUtilities (1.2.1)
Installing GoogleNetworkingUtilities (1.2.1)
Using GoogleSymbolUtilities (1.1.1)
Using GoogleUtilities (1.3.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 4 dependencies from the Podfile and 10
total pods installed.
Step 3
Now you should have Firebase 3. So you can add frameworks like such in your pod file then pod update
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'xMarket' do
end
target 'xMarketTests' do
end
target 'xMarketUITests' do
end
pod 'Firebase', '>= 2.5.1'
pod ‘Firebase/Core’
pod ‘Firebase/Database’
pod ‘Firebase/Auth’
Good luck!
P.S. You will also have to edit your codebase because Firebase 3 is different than Firebase 2. Check the documentation here Firebase 3 Examples
Above answers look great. I'll just add one link that has a lot of the common differences between Firebase 2 and Firebase 3: https://firebase.google.com/support/guides/firebase-ios#get_a_database_reference_numbered
(I didn't see this at first and wasted a few hours yesterday trying to figure it all out.)

Meteor: issue using alanning:roles with patch installed (upgrading project from v0.9.3.1 to v1.2.0.1)

I've just installed this patch for the alanning:roles package and I'm now getting these errors:
WARNING: Roles template helpers not registered. Handlebars or UI package not found
lookup.js:186 Uncaught Error: No such function: isInRole
This is the code the produces the first error:
if (Package.ui) {
_.each(Roles._uiHelpers, function (func, name) {
Package.ui.UI.registerHelper(name, func)
})
} else if (Package.handlebars) {
_.each(Roles._uiHelpers, function (func, name) {
Package.handlebars.Handlebars.registerHelper(name, func)
})
} else {
console.log && console.log('WARNING: Roles template helpers not registered. Handlebars or UI package not found')
}
Anyone know what I need do to sort these issues? Looks like this has come up before: link
this is my meteor list output:
accounts-password 1.1.3 Password support for accounts
accounts-ui 1.1.6 Simple templates to add login widgets to an app
alanning:roles 1.2.13+ Authorization package for Meteor
aldeed:autoform 5.5.1 Easily create forms with automatic insert and update, and automatic reactive...
aldeed:collection2 2.5.0 Automatic validation of insert and update operations on the client and server.
aldeed:simple-schema 1.3.3 A simple schema validation object with reactivity. Used by collection2 and a...
blaze-html-templates 1.0.1 Compile HTML templates into reactive UI with Meteor Blaze
cfs:filesystem 0.1.2 Filesystem storage adapter for CollectionFS
cfs:standard-packages 0.5.9 Filesystem for Meteor, collectionFS
ecmascript 0.1.4 Compiler plugin that supports ES2015+ in all .js files
ejson 1.0.7 Extended and Extensible JSON library
es5-shim 4.1.13 Shims and polyfills to improve ECMAScript 5 support
insecure 1.0.4 (For prototyping only) Allow all database writes from the client
iron:router 1.0.9 Routing specifically designed for Meteor
jquery 1.11.4 Manipulate the DOM using CSS selectors
matb33:collection-hooks 0.8.0 Extends Mongo.Collection with before/after hooks for insert/update/remove/fi...
meteor-base 1.0.1 Packages that every Meteor app needs
meteorhacks:npm 1.5.0 Use npm modules with your Meteor App
mobile-experience 1.0.1 Packages for a great mobile user experience
mongo 1.1.1 Adaptor for using MongoDB and Minimongo over DDP
mrt:accounts-admin-ui-bootstrap-3 0.2.7 A roles based account management system using bootstrap 3
mrt:jquery-jcrop 0.0.3 jQuery Jcrop repackaged for Meteor
mrt:loading 0.0.1 Loading overlay + spinner
npm-container 1.2.0+ Contains all your npm dependencies
random 1.0.4 Random number generator and utilities
session 1.1.1 Session variable
spacebars 1.0.7 Handlebars-like template language for Meteor
standard-minifiers 1.0.0 Standard minifiers used with Meteor apps by default.
tracker 1.0.8 Dependency tracker to allow reactive callbacks
twbs:bootstrap 3.3.5 The most popular front-end framework for developing responsive, mobile first...
The package needed to have blaze-html-templates listed as a weak dependency along with handlebars. Meteor 1.2 removed a lot of packages from the core that were installed by default.
The patch has been updated to reflect these changes.
api.use(['blaze-html-templates', 'handlebars'], 'client', {weak: true});
Instead of
api.use(['handlebars'], 'client', {weak: true});

Iron router: Error: Couldn't find a template named "/" or "". Are you sure you defined it?

I have trouble setting up a simple iron:router example: (docs, sample app)
meteor create testapp
cd testapp
home.html:
<template name="Home">
<h1>Welcome</h1>
home
</template>
router.js:
Router.route('/', function () {
this.render('Home'); // Also tried 'home'
});
Starting the server:
meteor
Then I get (client side):
Exception from Tracker recompute function: Error: Couldn't find a template named "/" or "". Are you sure you defined it?
at null._render (http://localhost:3000/packages/iron_dynamic-template.js?32038885cb1dad7957291ffebfffcb7f8cd57d20:239:17)
at doRender (http://localhost:3000/packages/blaze.js?88aac5d3c26b7576ac55bb3afc5324f465757709:1853:25)
...
What am I doing wrong ?
Note: I get the exact same error if I clone the example application (basic.html and basic.js).
meteor list
autopublish 1.0.1 Publish the entire database to all clients
insecure 1.0.1 Allow all database writes by default
iron:router 0.9.4 Routing specifically designed for Meteor
meteor-platform 1.1.2 Include a standard set of Meteor packages in your app
Also:
meteor --version
Meteor 0.9.4 <- Why all standard packages and meteor platform are > 1.0 and this is 0.9.4 ?
Currently, there are two versions of iron:router.
iron:router#0.9.4 is the one added by default when you type meteor add iron:router, this version is the latest in the "legacy" branch of iron:router that came up more than one year ago, it's the one that everyone is probably still using, although they should definitely update to...
iron:router#1.0.0-preX with X = 4 as of 20/10/2014, which is a complete rewrite of the package intended to be backward compatible, but introducing a new, nicer and polished API. This version will likely be set as default when meteor hits 1.0.0 later this year. The problem is that github page of iron:router shows this particular branch (1.0.0-pre4) along with examples that people believe are usable with 0.9.4.
This means that you are most likely using the wrong version of iron router, remove it with meteor remove iron:router and meteor add iron:router#1.0.0-pre4 instead.
Recommended reading to learn about the latest iron:router syntax :
http://eventedmind.github.io/iron-router/
Sometimes the guide is not completely up-to-date with the pre-release version, if you want to keep up with the latest stuff take a look at github issues.

Resources