Hi!
I am trying to use the ArcGIS Javascript Library with ES Modules and the app for some reason breaks when trying to add a FeatureLayer, this code is working fine using the CDN examples:
Here is a snippet of the code I'm testing:
if I remove the Feature Layer the map loads fine but once I add the FeatureLayer the application errors with the following:
any pointers or ideas of what could be causing this error would be really appreciated.
What does your build set up look like? We have a number of ESM samples here you can check against. https://github.com/Esri/jsapi-resources/tree/master/esm-samples
I'm using webpack. I just updated following the instructions in the link you shared and got the same error
Not sure. Does this happen in a particular browser/os combo? I put that snippet in a webpack build here and the build seems to be working ok.
https://github.com/odoe/jsapi-webpack-fl
Do you have a repro project we can test against?
I'm using it in a Ruby on Rails application using the webpacker gem I can provide an app that is presenting the error but I'm not 100% sure it would be very helpful because you will need a fully working rails dev env for it to work. I'm kind of a beginner in both webpack and the web packer gem but whatever I can do to help and figure out what's going on I'm happy to do.
Ha, it's been a minute since I used ruby/rails, but I'll see what I can do. If you have a project, that would help, but I can try and put one together.
So it turns out that, for some reason unknown to me, after upgrading the webpacker gem (rails wrapper for webpack) the FeatureLayers started working.
Thank you very much for your help @ReneRubalcava you pointed me into the direction for the solution, I appreciate it very much.