Customizer wont work

My customizer wont work, and don’t refresh live preview

lib/customizer.php
function full_banner_home_register($wp_customize){

    $wp_customize->add_section('full_banner_home', array(
        'title'    => __('Banner Home', 'sage'),
        'priority' => 120,
    ));

    $wp_customize->add_setting( 'fbh-text-1', array(
      'capability'  => 'edit_theme_options',
      'default'     => 'Escreva um texto aqui',
      'transport'   => 'postMessage', // or refresh
    ));
    $wp_customize->get_setting('fbh-text-1')->transport = 'postMessage';

    $wp_customize->add_control( 'fbh-text-1', array(
      'type'    => 'text',
      'section' => 'full_banner_home', // Required, core or custom.
      'label'   => __( 'Texto em negrito', 'sage' ),
    ));

}
add_action('customize_register', __NAMESPACE__ . '\\full_banner_home_register');

assets\customizer.js
(function($) {
// Site title
wp.customize(‘blogname’, function(value) {
value.bind(function(to) {
$(’.brand’).text(to);
});
});

  // Full Banner Home
  wp.customize('fbh-text-1', function(value) {
    value.bind(function(to) {
      $('.fbh-text-1').html(to);
    });
  });
})(jQuery);

whats wrong with my code?

I also have a similar issue. Customizer.php is added to dist with its sourcemap and in lib/customizer.php. No errors are showing running gulp.
The script is still inside manifest.json:

customizer.js": {
      "files": [
        "scripts/customizer.js"
      ]
    },

And when I run gulp watch and remove a newline in customizer.js and save I do see:

[BS] Proxying: https://ianua.dev
[BS] Access URLs:
 ---------------------------------------
       Local: https://localhost:3000
    External: https://192.168.1.101:3000
 ---------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.1.101:3001
 ---------------------------------------
[BS] Watching files...
[11:25:41] Starting 'jshint'...
[11:25:41] Finished 'jshint' after 421 ms
[11:25:41] Starting 'scripts'...
[BS] 3 files changed (customizer.js, jquery.js, main.js)
[11:25:45] Finished 'scripts' after 3.87 s

But on localhost (dev) I do not see customizer being loaded separately and it isn’t added to main.js either. Did you figure out what the issue was @Pablo_Gates ? Must be something trivial I am overlooking here.

Well, never mind. Cup of coffee and I realized the customizer.js is for the WP customizer and the way it is loaded in the customizer.php it will work for the customizer. So adding another script for the extra functionality I need now. Will also add it to manifest.json to get in enqueued:

{
  "dependencies": {
    "main.js": {
      "files": [
        "scripts/map.js",
        "scripts/new-script-needed-loading.js",
	"scripts/main.js"
      ],
      "main": true
    },
    "main.css": {
      "files": [
        "styles/main.scss"
      ],
      "main": true
    },
    "customizer.js": {
      "files": [
        "scripts/customizer.js"
      ]
    },
    "jquery.js": {
      "bower": ["jquery"]
    }
  },
  "config": {
    "devUrl": "https://ianua.dev/"
  }
}
1 Like