Hi,
I recently installed ES modules of ArcGIS Javascript SDK (v4.25) through npm install @ArcGIS/core and I am trying to import the symbolUtils.js module into my js code:
Unfortunately, I am getting the following error message and I haven't been able to find a solution:
import symbolUtils from '@arcgis/core/symbols/support/symbolUtils.js';
^^^^^^^^^^^
SyntaxError: The requested module '@arcgis/core/symbols/support/symbolUtils.js' does not provide an export named 'default'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5).
Does anybody know why this happens? Or is it a bug?
Through ADM, the following code seems to work (but I prefer to use an ES module):
Solved! Go to Solution.
That error means the module doesn't have a "export default something", so you can import the individual methods or all of them using "*".
import * as symbolUtils from "@arcgis/core/symbols/support/symbolUtils.js";
The import syntax is shown in the doc here.
https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html
That error means the module doesn't have a "export default something", so you can import the individual methods or all of them using "*".
import * as symbolUtils from "@arcgis/core/symbols/support/symbolUtils.js";
The import syntax is shown in the doc here.
https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html
Hi,
I was wondering how I could have missed your solution beforehand, because I had carefully read the provided syntax from ESRI.
However, using the syntax provided by ESRI gives me the following error:
Uncaught ReferenceError ReferenceError: ResizeObserver is not defined at <anonymous> (...\node_modules\@ArcGIS\core\widgets\support\widgetUtils.js:5:1462) at <anonymous> (...\node_modules\@ArcGIS\core\widgets\support\widgetUtils.js:5:1662) at run (internal/modules/esm/module_job:193:25)
Any ideas?
Thanks!
Thanks a lot! That solved it.
(I thought I had tried that as well, but that threw another error. I must have made a mistake. My apologies and thanks a lot for the quick reply!)