Closed ghost closed 7 years ago
Browser template?
What is this
on line 12 of lib/wiring/routs ?
Express-API template
And have not touched the file, but it is:
return this.charAt(0).toUpperCase() + this.slice(1)
Looks like it's trying to build out your routes. Do you have any syntax errors in your routes? What command are you running to spin up your server?
The routes.js file looks fine and there are no syntax errors. And I'm running: grunt server
Try nodemon
getting the same error
also, look through closed issues. I'm pretty sure it's something I've seen.
There have been somewhat similar issues, and I've tried implementing solutions, but still returning:
` return this.charAt(0).toUpperCase() + this.slice(1) ^
TypeError: Cannot read property 'charAt' of undefined`
Did you have a controller set up?
@parthgpatel How is this going?
got it to work. Passed in 'string' in place of 'this' on lines 11 and 12
I get the following message when running grunt server:
`/Users/parth/Desktop/Project-3-backend/lib/wiring/routes.js:12 return this.charAt(0).toUpperCase() + this.slice(1) ^
TypeError: Cannot read property 'charAt' of undefined at capitalize (/Users/parth/Desktop/Project-3-backend/lib/wiring/routes.js:12:14) at noController (/Users/parth/Desktop/Project-3-backend/lib/wiring/routes.js:16:38) at middlewares (/Users/parth/Desktop/Project-3-backend/lib/wiring/routes.js:36:5) at route (/Users/parth/Desktop/Project-3-backend/lib/wiring/routes.js:42:30) at actions.forEach.action (/Users/parth/Desktop/Project-3-backend/lib/wiring/routes.js:73:5) at Array.forEach (native) at Object.resources (/Users/parth/Desktop/Project-3-backend/lib/wiring/routes.js:67:11) at Object. (/Users/parth/Desktop/Project-3-backend/config/routes.js:21:2) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/Users/parth/Desktop/Project-3-backend/server.js:14:16)`