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
-
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' } } }
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 153 General Questions
- 148 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories