The first is that the ACF scripts are not included. You should enqueue your scripts on the acf/input/admin_enqueue_scripts hook. You should also use array('acf-input') as the script that your script depends on to make sure that acf is loaded first.
The second thing that could be happening is that you’re trying to run your script too early. You should not try to interact with ACF until after the document is ready.
// your code goes here
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users