tomwayson / esri-angular-cli-example

Example of how to to use the ArcGIS API for JavaScript in an Angular CLI app

Home Page:https://tomwayson.github.io/esri-angular-cli-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not resolve 'angular2-esri-loader' path after npm install

sidewaiise opened this issue · comments

I'm having some trouble with module resolution.

In your example you are using webpack. I'm not using webpack, I'm using gulp for build. (see the angular2-seed-material @ https://github.com/DeviantJS/angular2-seed-material2).

I believe there needs to be further definition or something of the module so that the path will resolve correctly. The error I get is:

(SystemJS) XHR error (404 Not Found) loading http://localhost:5555/node_modules/angular2-

esri-loader.js
Error: XHR error (404 Not Found) loading http://localhost:5555/node_modules/angular2-esri-loader.js
at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:5555/node_modules/zone.js/dist/zone.js?1485142762895:647:29)
at ZoneDelegate.invokeTask (http://localhost:5555/node_modules/zone.js/dist/zone.js?1485142762895:236:37)
at Zone.runTask (http://localhost:5555/node_modules/zone.js/dist/zone.js?1485142762895:136:47)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:5555/node_modules/zone.js/dist/zone.js?1485142762895:304:33)
Error loading http://localhost:5555/node_modules/angular2-esri-loader.js as "angular2-esri-loader" from http://localhost:5555/app/shared/map/map.module.js Not expecting this error? Report it at https://github.com/mgechev/angular2-seed/issues

@sidewaiise

Thank you for the feedback. The best place for this issue would be here https://github.com/tomwayson/angular2-esri-loader/issues since the purpose of this repo is to demonstrate how to use the ArcGIS API in an angular-cli app, which uses webpack.

That said, I don't anticipate that I'll work on this any time soon. Don't get me wrong, I very much want to support your use case. However, I experienced so much pain trying to publish a TypeScript package in a way that it could be generally consumed as an NPM module that I completely gave up on Angular and TypeScript. I've read half a dozen different blog posts and SO threads, all w/ conflicting information b/c the versions of TypeScript and Angular are shifting under our feet, the latest of which came out 2 days ago so maybe that's the answer, or maybe it's just another solution that works for one person on their project. Until that churn settles down at least, I'm not actively working on that repo.

So, if you post an issue over there, perhaps one of the other contributors will know what the problem is. Better still, if you make a PR that solves your problem, I will gladly review and merge if it doesn't break usage in this repo.