Because I needed to use some components from core/javascripts like the jQuery UI. But because those assets where included after my package assets I was getting "undefined function" javascript errors.

So to fix it, this is what I did:

From my Single Page Controller Task "edit" I marked the jquery/ui asset group as "already included" so I would get a duplicate function error.
Then I included my jquery-ui.js version from my package assets /packages/PACKAGE_NAME/js/jquery-ui.js

$this->addFooterItem($hh->javascript('jquery-ui.js',$this->pkgHandle));
$this->addFooterItem($hh->javascript('file-manager.js',$this->pkgHandle)); <---- This was the file that required the jquery-ui to be included before it

}

So now when I look at the footer items in the source code, the sequence is correct

Because I needed to use some components from core/javascripts like the
jQuery UI. But because those assets where included after my package assets
I was getting "undefined function" javascript errors.

So to fix it, this is what I did:

From my Single Page Controller Task "edit" I marked the jquery/ui asset
group as "already included" so I would get a duplicate function error.
Then I included my jquery-ui.js version from my package assets
/packages/PACKAGE_NAME/js/jquery-ui.js