Hello, I am trying to copy the common print widget and want to customize it a little. I found it in the client/dist/widgets/common folder, copied the src folder and manifest.json, icon.svg, config.json to client/your-extensions/widgets/CustomPrintWidget folder and changed the manifest file to match the folder name.
Now I am getting an error when trying to build the widget:
ERROR in ./your-extensions/widgets/CustomPrintWidget/src/setting/component/report-template-setting.tsx 14:0-69 Module not found: Error: Can't resolve 'jimu-ui/advanced/app-item-selector' in 'D:\Users\pratybos\Desktop\ArcGIS Experience Builder Dev\ArcGISExperienceBuilder\client\your-extensions\widgets\CustomPrintWidget\src\setting\component' resolve 'jimu-ui/advanced/app-item-selector' in 'D:\Users\pratybos\Desktop\ArcGIS Experience Builder Dev\ArcGISExperienceBuilder\client\your-extensions\widgets\CustomPrintWidget\src\setting\component'
To my understanding this error is shown because the widget doesn't know where some modules are. How do I config it so it finds the necessary modules? Editing dependencies in manifest doesn't seem to work. Do I need to use the loadArcGISAPIModules function? Or is there some better way to point where the module is stored?
Thanks in advance, all help is appreciated.
Solved! Go to Solution.
There may be something wrong with your workflow or with your install. Compare what you are doing with the example below. If the processes match, maybe try reinstalling EB.
I just confirmed this workflow works:
The 'jimu-ui/advanced/app-item-selector' component has been moved from jimu-ui to the Print widget. I guess you copied the Print widget from the old version of dev.
It might be that my Experience builder version is older, but I copied it into the same developer installation, just into 'your-extensions' folder. Should it not at least work with my current installation or am I missing something?
If you want to create a copy of one of the stock widgets, that's easy enough. But you need to do two things:
I have changed the name of the widget and I have run the npm start command in the client folder, that is exactly where I get this error that the widget can't be built because it can't find some modules, that the original widget has no issue finding.
There may be something wrong with your workflow or with your install. Compare what you are doing with the example below. If the processes match, maybe try reinstalling EB.
I just confirmed this workflow works:
Seems like the issue was with my version EB, thanks for the help.