Esri / angular-esri-map

A collection of directives to help you use Esri maps and services in your Angular applications
https://esri.github.io/angular-esri-map/
Apache License 2.0
213 stars 107 forks source link

Critical dependency: the request of a dependency is an expression #332

Closed MrOnyancha closed 7 years ago

MrOnyancha commented 7 years ago

Expected behavior

-angular-esri-map does not work well with "webpack": "2.2.0",.

Actual behavior

WARNING in ./~/angular-esri-map/dist/angular-esri-map.js
94:16-97:18 Critical dependency: the request of a dependency is an expression

ERROR in ./~/angular-esri-map/dist/angular-esri-map.js
Cannot statically analyse 'require(..., ...)' in line 108
 @ ./src/app/app.js 8:0-26
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app/app.js
jwasilgeo commented 7 years ago

@MrOnyancha, can you provide some more info please? What is the content of your webpack config file?

jwasilgeo commented 7 years ago

Closing for now due to inactivity.

sirhcybe commented 4 years ago

@jwasilgeo I know this library is super old but I'm trying to incrementally upgrade an Angularjs application and have this problem too. I'm happy to provide any info needed to troubleshoot it.

andygup commented 4 years ago

@sirhcybe just a friendly reminder, this repo using AngularJS is officially retired and we aren't actively supporting it. Google recommends all customers start considering migrating to Angular. If there are folks in the community that have insight into this issue please feel free to respond.

With regards to migrating to Angular, here's a link to the most current repo that supersedes this one: https://github.com/Esri/angular-cli-esri-map.

Also just a reminder that AngularJS itself is in Long Term Support and its end of maintenance is scheduled for June 30, 2021.

sirhcybe commented 4 years ago

@andygup Thanks for the response. I wish our clients willingness to fund upgrades corresponded with Google's support timelines.

I did find a workaround for this. To fix it I removed angular-esri-map from my node_modules so that it is not built with webpack. Then I added it to my html page using the unpkg CDN link. After that I was able to inject the esriLoader service into my controllers and restructure all of the old require statements to use esriLoader.require. This will hold us over until our incremental upgrade to Angular is complete.