Localizing Post ID Causes WordPress Error

Solution:

The response is as @FluffyKitten put it: Post IDs are numbers not strings, so the thing precisely would you say you are attempting to restrict? The issue is there in the blunder message – wp_localize_script anticipates an exhibit yet you are not passing a cluster into it. In the event that you check the boundary list for wp_localize_script you’ll see which boundary should be an exhibit, then, at that point, fix the worth your passing in everyehere it isn’t right.

I changed to wp_localize_script(‘extra-script’, ‘my_postid’, array ( get_the_ID() ) ); and it fixed the issue.