Select to view content in your preferred language

Using components from shared-code in widget setting

503
4
Jump to solution
05-06-2025 05:32 AM
WalaZargouni
Emerging Contributor

Hello everyone, I'm trying to import a component declared in the shared-code folder to my widget setting file but i always end up with this error : 

Load module error. TypeError: window.require is not a function

My question is : is it already possible to consume components from the shared-code folder in the setting file of a widget ? if so how can I achieve that ?

I am using ExB 1.17 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JunshanLiu
Esri Contributor

Can you add the settingDependency: "jimu-arcgis" in the menifest.json?

View solution in original post

0 Kudos
4 Replies
ShengdiZhang
Esri Regular Contributor

Hi @WalaZargouni ,

Can you check if you are using import and export correctly?

ShengdiZhang_1-1746669800526.jpeg

 

ShengdiZhang_0-1746669792440.png

Regards,

Shengdi

0 Kudos
WalaZargouni
Emerging Contributor

Hello @ShengdiZhang 

Yes i'm doing the import and export just like that and it works fine when i use the exported components in other places other than setting.tsx

0 Kudos
JunshanLiu
Esri Contributor

Can you add the settingDependency: "jimu-arcgis" in the menifest.json?

0 Kudos
WalaZargouni
Emerging Contributor

Hi @JunshanLiu 
I did that and it solved my problem, thank you

0 Kudos