meteor / postgres-packages

Early preview of PostgreSQL support for Meteor (deprecated, here for historical reasons)
http://meteor-postgres.readthedocs.org/
158 stars 25 forks source link

Global variable PG is not defined #38

Closed yoonghm closed 8 years ago

yoonghm commented 8 years ago

I try to convert leaderboard from using MongoDB to PostgreSQL.

.
├── client
│   ├── leaderboard2.html
│   ├── lib
│   │   └── leaderboard2.js
│   └── style.css
├── lib
│   └── init.js
├── public
│   └── css
└── server
    └── leaderboard2.js

my init.js is

var PG = Package['simple:pg'].PG
Item = new PG.Table(items);

console.log('Item = ' + Item);

However, it does not seem understand PG. How do you make this possible?

I noticed that I do not have the file

./.meteor/local/build/programs/web.browser/packages/simple_pg.js
./.meteor/local/build/programs/web.cordova/packages/simple_pg.js
./.meteor/local/build/programs/server/packages/simple_pg.js

How did you populate it? The document http://meteor-postgres.readthedocs.org/en/latest/ does not mention anything about it.

I performed meteor list on postgres-packages/example/react-todos

 meteor list
/home/me/.meteor/packages/meteor-tool/1.1.9/mt-os.linux.x86_64
=> Errors while initializing project:         

While selecting package versions:
error: unknown package in top-level dependencies: simple:pg
yoonghm commented 8 years ago

[Update]: Saw the issue #28 on

error: unknown package in top-level dependencies: simple:pg
yoonghm commented 8 years ago

Finally fixed it myself

1. Update .meteor/packages by adding
simple:pg
2. Set PACKAGE_DIRS to the directory that contains `pg package. For my case, it is in
./postgres-packages/packages
yoonghm commented 8 years ago

Closed the issue to early. Even I have fixed the problems that I had encountered, I still cannot find out where PG is defined. Help is needed.

amandaaurita commented 7 years ago

I am having the same problem. :/

snubydev commented 7 years ago

The same problem: "Uncaught ReferenceError: PG is not defined"