Skip to content

Example in README does not work #16

Closed

Description

@dbkaplun
> var knex = require('feathers-knex');
undefined
> var todos = knex('todos', {
...   dialect: 'sqlite3',
...   connection: {
.....     filename: './data.db'
.....   }
... });
TypeError: knex is not a function
    at repl:1:13
    at REPLServer.defaultEval (repl.js:164:27)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:393:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:210:10)
    at REPLServer.Interface._line (readline.js:549:8)
    at REPLServer.Interface._ttyWrite (readline.js:826:14)
    at ReadStream.onkeypress (readline.js:105:10)
    at emitTwo (events.js:87:13)
    at ReadStream.emit (events.js:172:7)
    at emitKeys (readline.js:1250:14)
    at next (native)
    at ReadStream.onData (readline.js:918:36)

Activity

  1. daffl commented on Nov 23, 2015

    @daffl
    Member

    You are indeed correct. We only tested it with ES6 and Babel which uses a default export called .default. I published a new version (1.2.1) that should fix the issue.

  2. daffl commented on Nov 23, 2015

    @daffl
    Member

    Actually, although this will work, it should probably really use https://www.npmjs.com/package/babel-plugin-add-module-exports. Reopening to make another release with that plugin.

  3. reopened this on Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions