koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
667 stars 128 forks source link

Cannot read property 'getCount' of undefined #290

Closed gavinr closed 8 years ago

gavinr commented 8 years ago

I get the following error on a basic koop install:

λ node .\index.js
warn: No cache configured, defaulting to local in-memory cache. No data will be cached across server sessions.
F:\github\kooptest\node_modules\koop-provider\lib\model.js:261
    getCount: koop.Cache.getCount,
                        ^

TypeError: Cannot read property 'getCount' of undefined
    at Function.model (F:\github\kooptest\node_modules\koop-provider\lib\model.js:261:25)
    at Provider.gistModel [as model] (F:\github\kooptest\node_modules\koop-gist\model\index.js:12:24)
    at EventEmitter.koop.registerProvider (F:\github\kooptest\node_modules\koop\index.js:119:26)
    at EventEmitter.koop.register (F:\github\kooptest\node_modules\koop\index.js:97:21)
    at Object.<anonymous> (F:\github\kooptest\index.js:6:6)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

Replication:

contents of index.js:

var koop = require('koop')({
  'ghtoken': 'MYTOKEN' // defaults to `process.env.KOOP_GIST_TOKEN`
})
var koopGist = require('koop-gist')
koop.register(koopGist)
var app = require('express')()
app.use(koop)
app.listen(process.env.PORT || 1337, function () {
  console.log('Listening at http://%s:%d/', this.address().address, this.address().port)
})

I'm aware that a cache is recommended, but shouldn't it at least work without one? Thanks!

dmfenton commented 8 years ago

Can you show me the version of Koop?

gavinr commented 8 years ago
koop@3.0.0-alpha.26
koop-gist@2.0.0
dmfenton commented 8 years ago

Koop 3.x is not stable at this time. Only a few providers will work with it. I recommend sticking to Koop 2.x

gavinr commented 8 years ago

Gotcha. Seeing that that's the version that comes over when you do a npm install koop right now, we may want to add a note to the doc, or set it up so the current stable version is the default when a user runs npm install koop?

Thanks for the help!

dmfenton commented 8 years ago

Updated!

jgravois commented 8 years ago

i still like @gavinr's idea of ensuring that npm install koop lays down '2.x'.

this can be achieved by manually adding 'latest' as the dist-tag each time a new 2.x version hits the streets.

# adding a tag to an existing release
npm dist-tag add koop@2.12.1 latest

# for 2.x
npm publish --tag latest 

# for 3.x
npm publish --tag experimental 
dmfenton commented 8 years ago

Cool! I didn't know you could do that.