Why am I receiving an error for my extension code on my SCA site? I am deploying using Gulp.

I’m having issues with creating an extension for an SCA test site. I’m trying to have an announcement message be displayed in the header area of the site. I’m using the extensibility API. I am also deploying using Gulp

When I deploy my files, the first statement at the top: “import { callbackify } from “util” ” is added, but when viewing the website, I do not see my extension working, and console shows an error being thrown at that statement. The Console shows “cannot use import statement outside of module”

import { callbackify } from "util"define("HeaderCustomizations.View", [
    "Backbone", "header_customizations.tpl"
], function(Backbone, header_customizations_tpl){  

  console.log('Inside View');    

  return Backbone.View.extend({       
  template: "header_customizations_tpl",    
  
  initialize: function(options){
            this.message = options.container.getConfig("announcement.message") || "This is a sample announcement!";            
            this.firstname = options.profileData.firstname;
        },        
            events:{"click [data-action='close']" : 'hideBanner'
        },   
            hideBanner: function(){
            this.$el.remove();
        },         
            getContext: function(){
            return{
                message: this.message,
                firstname: this.firstname
            }
        }
    })
})
Rookie Asked on May 15, 2020 in SuiteCommerce.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor