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 trial

JavaScript Express Basics (2015) Developing Express Apps Like a Boss Interactive Debugging and Exploratory Programming

Deano k
PLUS
Deano k
Courses Plus Student 5,872 Points

can'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
Deano k
Courses Plus Student 5,872 Points

Thanks 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!"); });

The problem is not with your code. I have the same issue here. Looking forward for helpful answers.

3 Answers

I 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.