sean-olson-e / Angular-and-the-ArcGIS-API-for-JavaScript

This repository contains resources to support the Esri Developer Summit presentation, Angular and the ArcGIS API for JavaScript. Here you will find all of the samples apps, presentation slides, and Readme files that provide guidance for each pattern.
27 stars 12 forks source link

problem accessing esri types in multi-app repo structure #18

Closed jwasilgeo closed 6 years ago

jwasilgeo commented 6 years ago

Hi @andygup. There might be another small hiccup to figure out with ts's knowledge of types in our current multi-app configuration in this repo.

Right now, in an esri-map.component.ts I'm getting a ts error that [ts] Cannot find name '__esri'. If I go to the sample app's top-level tsconfig.json (e.g.: /samples/1-app-scaffolding/tsconfig.json) and adjust the "typeRoots" json property from

"typeRoots": [
  "node_modules/@types"
],

to

"typeRoots": [
  "../../node_modules/@types"
],

then we seem to be back in business.

And no, in my environment, "./node_modules/@types" doesn't seem to fix it. Doesn't this strict 2-levels-up "typeRoots" seem brittle and unsustainable? It'll be fine for our needs over the next several weeks, but it feels weird leaving it like this.

What do you think?

jwasilgeo commented 6 years ago

cc @sean-olson-e if you’re interested, but I didn’t want to bug you with this

jwasilgeo commented 6 years ago

Closing since we know this is a problem for posterity, but won't be affecting us anymore.