Error in requirejsDependencyCheck

Hi team,

I want to reference a widget which lies in another bundle of ours.

I changed the config-build.js to locate the widget prefix, so the path to the widget is correctly resolved.

However when I grunt, I get an error :

Running "requirejsDependencyCheck:all" (requirejsDependencyCheck) task
>> Module ptfd/utils/commands/open.ptfdb depends on gciux/widgets/tilereport/tilereport.view, which is not public; it does not occur in any foreign bundle index.
>> Error: At least one module depends on a private module from other component.

How can I avoid this ? 

Thanks,

Pierre

Comments

  • Never mind, I found out I had to add gciux:'empty:' in config.build.js

  • Ferdinand Prantl
    Ferdinand Prantl E Community Moderator

    You build a Smart UI komponent "ptfd", which depends on another component "gciux". The error meant, that you depend on their module "gciux/widgets/tilereport/tilereport.view", which they did not declare public. If you ignore it, a part of Smart UI may fail loading intermittently, depending on the immediate order of loaded JavaScript module bundles.

    1. You should have only your source code analysed during the build. It is done by pointing all other components to "empty:" location in config-build.js.

      require.config({    paths: {      // dependencies      csui: 'empty:',      gciux: 'empty:',      // this component      ptfd: '.',      // plugins      ...    },    ...

    2. You should check, that you depend only on public modules to prevent Smart UI loading failures. (Only public modules trigger module bundle loading.) It is done by running the Grunt task "requirejsDependencyCheck":

      var csuiComponent = require('../lib/src/csui/component')  var gciuxComponent = require('../lib/src/gciux/component')  var csuiModules = csuiComponent.getAllModules()  var gciuxModules = gciuxComponent.getAllModules()  var modulesWeCanDependOn = csuiModules.concat(gciuxModules)  var moduleAliasesToExclude = csuiComponent.getAllRequireJsPlugins()  var ourModuleBundles = [    {      name: 'bundles/ptfd-all',      exclude: moduleAliasesToExclude    }  ]  requirejsDependencyCheck: {    all: {      options: {        prefix: 'ptfd',        bundles: ourModuleBundles,        dependencies: modulesWeCanDependOn,        config: 'config-build.js'      }    }  }
     
    3. If you have more module bundles, than just the initial one (ptfd-all.js), you should check, that each module gets written to exactly one bundle. The bundles have to be distinct to prevent RequireJS loading errors. It is done by running the Grunt task "requirejsBundleCheck":
      requirejsBundleCheck: {    all: {      options: {        prefix: 'ptfd',        dependencies: ourModuleBundles,        config: 'config-build.js'      }    }  }
  • This is very useful. Thanks !

     

    Pierre

  • Hi Team ,

    Smart UI is not loading in the content server and it's a blue screen. Where to add Empty.