Skip to content

meteor js integration #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stevenbarragan opened this issue Mar 24, 2014 · 5 comments
Closed

meteor js integration #548

stevenbarragan opened this issue Mar 24, 2014 · 5 comments

Comments

@stevenbarragan
Copy link

I'm trying to integrate node-postgress to my meteor application but I'm getting some errors, when I try to run the app.

First errors

node_modules/pg/script/setup-bench-data.js:3:3: Unexpected token .

File

var pg = require('../lib');
var 
pg.connect(function(err, client) {

})

I delete the extra "var" and it works

var pg = require('../lib'); 
pg.connect(function(err, client) {

})

Then:

W20140324-12:49:25.508(-6)? (STDERR) /Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/fibers/future.js:173
W20140324-12:49:25.509(-6)? (STDERR) throw(ex);
W20140324-12:49:25.509(-6)? (STDERR)      ^
W20140324-12:49:25.513(-6)? (STDERR) ReferenceError: exports is not defined
W20140324-12:49:25.514(-6)? (STDERR)     at app/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:99:1
W20140324-12:49:25.514(-6)? (STDERR)     at app/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:469:3
W20140324-12:49:25.514(-6)? (STDERR)     at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:155:10
W20140324-12:49:25.515(-6)? (STDERR)     at Array.forEach (native)
W20140324-12:49:25.515(-6)? (STDERR)     at Function._.each._.forEach (/Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/underscore/underscore.js:79:11)
W20140324-12:49:25.517(-6)? (STDERR)     at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:82:5

file:

exports.Pool = function (factory) {
  var me = {},
.

and I did this:

exports = typeof exports === "undefined" ? {} : exports
exports.Pool = function (factory) {
  var me = {},

then:

W20140324-12:57:58.598(-6)? (STDERR) /Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/fibers/future.js:173
W20140324-12:57:58.598(-6)? (STDERR) throw(ex);
W20140324-12:57:58.599(-6)? (STDERR)      ^
W20140324-12:57:58.602(-6)? (STDERR) ReferenceError: require is not defined
W20140324-12:57:58.602(-6)? (STDERR)     at app/node_modules/pg/node_modules/pgpass/lib/helper.js:3:12
W20140324-12:57:58.602(-6)? (STDERR)     at app/node_modules/pg/node_modules/pgpass/lib/helper.js:232:3
W20140324-12:57:58.603(-6)? (STDERR)     at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:155:10
W20140324-12:57:58.603(-6)? (STDERR)     at Array.forEach (native)
W20140324-12:57:58.604(-6)? (STDERR)     at Function._.each._.forEach (/Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/underscore/underscore.js:79:11)
W20140324-12:57:58.604(-6)? (STDERR)     at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:82:5

file:

var path = require('path')
  , Stream = require('stream').Stream
  , Split = require('split')
  , util = require('until')

I change it to:

var path = Npm.require('path')
  , Stream = Npm.require('stream').Stream
  , Split = Npm.require('split')
  , util = Npm.require('util')

But I'm still getting this errors....

W20140324-13:00:53.582(-6)? (STDERR) /Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/fibers/future.js:173
W20140324-13:00:53.583(-6)? (STDERR) throw(ex);
W20140324-13:00:53.583(-6)? (STDERR)      ^
W20140324-13:00:53.587(-6)? (STDERR) ReferenceError: module is not defined
W20140324-13:00:53.587(-6)? (STDERR)     at app/node_modules/pg/node_modules/pgpass/lib/helper.js:40:23
W20140324-13:00:53.588(-6)? (STDERR)     at app/node_modules/pg/node_modules/pgpass/lib/helper.js:232:3
W20140324-13:00:53.588(-6)? (STDERR)     at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:155:10
W20140324-13:00:53.588(-6)? (STDERR)     at Array.forEach (native)
W20140324-13:00:53.588(-6)? (STDERR)     at Function._.each._.forEach (/Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/underscore/underscore.js:79:11)
W20140324-13:00:53.589(-6)? (STDERR)     at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:82:5

file:

Object.defineProperty(module.exports, 'isWin', {
    get : function() {
        return isWin;
    } ,
    set : function(val) {
        isWin = val;
    }
});

I guess they are because of the way the file are being loaded, but I'm not sure.

Does somebody has any idea about what could I do?
I'll really appreciate it.

@brianc
Copy link
Owner

brianc commented Mar 24, 2014

Hey @stevenbarragan I really don't have any experience with meteorjs. Does it use its own module system or something?

The only code you referenced above I directly control is the first reference to /script/setup-bench-data.js which is no longer used and never required ever from node postgres anywhere so I'm not sure why it's being pulled into meteor? Very strange.

As far as the other modules you might want to open issues on pg-pass and generic-pool about their meteorjs compatibility. I'll happily bump my version to reference a compatible version of their module once they get them released.

@stevenbarragan
Copy link
Author

As far as I know meteor loads all javascript files in the project, it could be why it's loading that file that you said it's not longer used. Could you please remove it? if you want it I could do a PR with that.

I'll try to open issues on the other modules as you say.

Thank you!!

@booo
Copy link
Contributor

booo commented Apr 16, 2014

I removed the file. I suggest we close the issue now and @stevenbarragan creates a pull request once the the other modules are ready.

@hoegaarden
Copy link
Contributor

@stevenbarragan already closed the issue for my module, so I guess we can close this one too ...

@booo
Copy link
Contributor

booo commented Apr 17, 2014

Ok. I'm closing this one too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants