isomorphic-tutorial icon indicating copy to clipboard operation
isomorphic-tutorial copied to clipboard

`callback()`: TypeError: string is not a function

Open woffleloffle opened this issue 10 years ago • 0 comments

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

woffleloffle avatar Mar 10 '15 07:03 woffleloffle