enqueue_script with filemtime javascript not working

wp_register_script() function is accepting the 5 parameters. You are passing the 6 parameter. So replace the

wp_register_script(
    'lib',
    get_template_directory_uri().'/js/lib.js', 
    array(), 
    filemtime(get_template_directory() . '/js/lib.js'), 
    null, 
    'all'
);

WITH

wp_register_script(
    'lib',
    get_template_directory_uri().'/js/lib.js', 
    array(), 
    filemtime(get_template_directory() . '/js/lib.js'), 
    true
);