Hello,
In the Experience Builder Dev Edition 1.9, I'm trying to create an AppConfigProcessor extension point in order to modify widget's config programmatically when the application loads.
I followed these following articles and examples :
https://developers.arcgis.com/experience-builder/guide/extension-points/
https://github.com/Esri/arcgis-experience-builder-sdk-resources/blob/d6b9dd8280635ef585b05166d4e485d693143603/widgets/translation/src/extensions/translation.ts
In the process function, I also need to access object from the ArcGIS API, in particular, I need to access esri/config.
Here is my code :
import esriConfig from 'esri/config'
import { extensionSpec, AppConfig, utils } from 'jimu-core'
import { IMConfig } from '../config'
export default class configProcessor implements extensionSpec.AppConfigProcessorExtension {
id = 'pp-config'
widgetId: string
async process (appConfig: AppConfig): Promise<AppConfig> {
// configuration of the current widget
const widgetConfig: IMConfig = appConfig.widgets[this.widgetId].config
// need to set this property to false
esriConfig.request.useIdentity = false
// do stuff with appConfig
//...
//
return Promise.resolve(appConfig)
}
}
The loading of esri/config failed with this error when I start the application :
Load module error. TypeError: window.require is not a function
I tried with other class from the API and I'm still getting the same error.
Here is the manifest.json :
{
"name": "config-extension",
"label": "Configuration Extension",
"type": "widget",
"version": "1.10.0",
"exbVersion": "1.9.0",
"author": "Matthieu",
"description": "Configuration de l'application",
"copyright": "",
"license": "http://www.apache.org/licenses/LICENSE-2.0",
"properties": {},
"translatedLocales": [
"fr"
],
"extensions": [
{
"point": "APP_CONFIG_PROCESSOR",
"uri": "extensions/ppConfigProcessor"
}
],
"dependency": ["jimu-arcgis"]
}
Any ideas ?
Thanks
Matthieu