Question: I'm creating a lightning component named "scroll" and a controller file associated with it. Here's the opening tag of .cmp file:

```
<aura:component controller="scrollController" implements="force:appHostable,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes" access="global" >

```

Every time I try to save the `.cmp` file, I get this error:

> 
> Failed to save scroll.cmp: Invalid definition for
>  null:scrollController: null: Source
> 
> 
> 

If I remove `controller="scrollController"` it will save no problem.

I stripped down the controller file to just a simple alert to weed out any possible JS issues:

```
({
     scroll: function() {

            alert('this works');

    },    
})

```

Answer: 
The controller attribute is used for an Apex class. You do not specify this attribute for any of the source files (e.g. scrollController.js in your bundle). You would use the controller attribute to access Apex code methods, such as performing DML, querying data, or making callouts.
I believe this error is tied to the Apex controller reference on the lightning component. When I encountered this error it was because I was attempting to push an aura lightning component with a change set and I did not include the Apex Controller. Adding the Apex class to the change set fixed the deployment error.