Intellisense see the request object in the onRequest function as a ClientRequest object and not an IncomingMessage object:
```
var http = require("http");
var url = require("url");
function start(route, handle)
{
function onRequest(request, response)
{
var pathname = url.parse(request.url).pathname;
console.log("Request for " + pathname + " received.");
route(handle, pathname, response);
}
http.createServer(onRequest).listen(8888);
console.log("Server has started");
}
exports.start = start;
```
This means that request.url is of unknown type, same for pathname. I am not sure if this is the reason, but in the route function all the parameters are of unknown type after that and the inferred type tracking stop working at that point.
```
var http = require("http");
var url = require("url");
function start(route, handle)
{
function onRequest(request, response)
{
var pathname = url.parse(request.url).pathname;
console.log("Request for " + pathname + " received.");
route(handle, pathname, response);
}
http.createServer(onRequest).listen(8888);
console.log("Server has started");
}
exports.start = start;
```
This means that request.url is of unknown type, same for pathname. I am not sure if this is the reason, but in the route function all the parameters are of unknown type after that and the inferred type tracking stop working at that point.