Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDeano k
Courses Plus Student 5,872 Pointscan't access variables in the console (in the debbuger)
Trying to access response \ request for example I get no value returned back.
I see an error message at the top of the console, not sure if it's related.. the error reads "Internal error: illegal access"
Deano k
Courses Plus Student 5,872 PointsThanks man
'use strict';
var express = require('express'); var posts = require('./mock/posts.json'); var app = express();
app.get('/', function (request, response){ response.send("<h1>I Love Treehouse</h1>"); });
app.get('/blog/:title?', function(request, response){ debugger; var title = request.params.title; if (title === undefined) { response.status(503); response.send("This page is under construction!"); } else { var post = posts[title]; response.send(post); } });
app.listen(3000, function(){ console.log("The frontend server is running on port 3000!"); });
Mindaugas Kunevičius
12,029 PointsThe problem is not with your code. I have the same issue here. Looking forward for helpful answers.
3 Answers
Mason Macias
6,789 PointsAll I can find about it currently, seems to be a V8 problem. https://github.com/node-inspector/node-inspector/issues/413
Mason Macias
6,789 PointsAdded an issue to Node Inspector stay tuned here! https://github.com/node-inspector/node-inspector/issues/864#issuecomment-217167887
Anthony Albertorio
22,624 PointsI am having the same issues as well as of April 6th, 2017. However, If you hover over the req or res inside the .get function of your routes, you will see the list of properties for the corresponding object. In order for this to work you must have at least one break point in debug mode (I ran node-debug app.js in the terminal). If you try to hover over without the program being paused during debug mode, you will not be able to see the aforementioned properties.
Hope this helps.
Julio Andrade
Courses Plus Student 10,896 PointsJulio Andrade
Courses Plus Student 10,896 PointsCan I see your code please