Skip to content

callback(): TypeError: string is not a function #15

@woffleloffle

Description

@woffleloffle

Browse to a single post, hit refresh in the browser.

  callback(null, 'Posts', {posts: posts});
  ^
TypeError: string is not a function
    at .\app\routes.js:17:7
    at Request.callback (.\node_modules\superagent\lib\node\index.js:746:30)
    at Request.<anonymous> (.\node_modules\superagent\lib\node\index.js:135:10)
    at Request.emit (events.js:95:17)
    at IncomingMessage.<anonymous> (.\node_modules\superagent\lib\node\index.js:938:12)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:943:16
    at process._tickCallback (node.js:419:13)

10 Mar 09:00:15 - [nodemon] app crashed - waiting for file changes before starting...

I believe this is due to the duplicate routes:

  • /posts
  • /posts/:id

I'll submit a clean pull request to fix this in a bit.

:{D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions