How to fade out an object with no renderer (and how is that even possible?!)

Noob here, cribbing from other scripts, I see that I can do...

target.renderer.material.color.a -= Time.deltaTime/fadeDuration;

to fade out an object. And, elsewhere in the docs, I see that EVERYTHING YOU SEE ON SCREEN has a renderer that you can enable = true/false to show/hide it. Ok... but the above line gives me "renderer is not a component of GameObject" error. So, being resourceful, I think...

var target : GameObject;
var targetRenderer : Renderer;

function Start()
{
    targetRenderer = target.GetComponent(Renderer);
    if (targetRenderer == null)
        targetRenderer = target.GetComponentInChildren(Renderer);
}

function Update()
{
    if (targetRenderer.material.color.a > 0)
        targetRenderer.material.color.a -= Time.deltaTime/fadeDuration;
}

but then I get "trying to access Renderer on GameObject when there is none." What gives? What am I missing?! If it's on-screen, it's got to have a renderer, right?!

Thanks!

P.S. All I really want to do is make my object fade out before removing him from the scene, like in TonyD's script, here.

The first line of code you wrote is fine, but you haven't given enough info about how you're defining variables. For example, this works with no issues, assuming the target object actually has a renderer:

var target : GameObject;

function Update () {
   target.renderer.material.color.a -= Time.deltaTime/fadeDuration;
}

But a GameObject doesn't necessarily have a renderer. The only required component is a Transform. If you're trying to access a renderer component of a child GameObject where no renderer component exists, then you will get the error message you quoted.