wp_enqueue_script error with `ID`, `post_title`, `post_name` of none object

Issue 1

I was not seeing the embedded object in javascript because:

The error was, I thought plugins_url always resolved to the plugins dir, it resolves to the dir of __FILE__:

In my situation myplugin.js and myplugin.php are both in the same public/ dir, so this:

$script_url = plugins_url( 'public/myplugin.js', __FILE__ )

Was resolving as (notice the double public):

http://server.example.com/wp-content/plugins/myplugin/public/public/myplugin.js

instead of

http://server.example.com/wp-content/plugins/myplugin/public/myplugin.js

Issue 2

I still see the error, however even with my plugin disabled, and managed to track it down to WooComerce by looking at the debug network tab and seeing the ajax request.