-
Notifications
You must be signed in to change notification settings - Fork 5
Visual Studio 2015 RC1 & Esri System Js #6
Comments
@davidkwong where are you trying to use Here's an example of how the import statement can be written: https://github.com/jwasilgeo/angular2-esri-playground/blob/master/app/esri-map-view.component.ts#L3 |
I don't think you'll be able to get any kind of code completion or IntelliSense out of this. At a minimum you could inform your linter to ignore that |
I agree that I won't be able to have intellisense. One thing I don't understand is that why it won't compile down to plain javascript in visual studio . Is my config in SystemJs has anything to do with that ? |
First, I would say get it compiling at the command line first, then troubleshoot VS. One thing that jumps out at me is the Can you try using the same versions of dependencies that are known to work? Same w/ your tsconfig.json, the settings are slightly different than known working examples. Can you try using exact same config and run W/o seeing your app.component that's about all I can suggest. Unfortunately, I won't be able to help w/ VS studio at all, as I haven't used it in years. |
Tried a couple more times. Change to match the dependency. Still not compiling .I suspect there is some issues with Visual Studio or the ASP.NET Core Framework. I use nodejs and run the example app in the repository and everything seems fine. I probably wait until ASP.NET Core RC2 before I try it again. So tired about it. app.component.ts
|
Thanks for sharing app.components.ts - I don't see anything in there that looks out of place. I just want to verify that you're still not able to compile the app from the command line (w/ |
Hi @jwasilgeo and @tomwayson @tomwayson I can confirm that using the command line with tsc without Visual Studio in my own app give me the same error "Cannot find module 'esri-mods'". I cannot fix that so I thought "Forget it I should start again from the working repo @jwasilgeo . One thing I do find it very strange is that: When I add "rotation: number = null;" , the error "Cannot find module 'esri-mods'" start coming back". |
@davidkwong, thanks for the details. So after pulling latest master of https://github.com/jwasilgeo/angular2-esri-playground and
I then went and added
The app seems to be running fine after those changes. Did you fix all the type errors (in other files)? I did that, using type
The important part is that the app kept running fine the whole time, even w/ that TS compile error. I've made a PR to @jwasilgeo's repo to clean up his sloppy code. 😉 You can see the changes I made there. I use Visual Studio Code when working in TypeScript, and I do also see the errors in the IDE: However, it does not prevent me from carrying out my workflow. Does that error make it so that you can't work in VisualStudio? If so, then perhaps it's more a matter of Esri Dojo JavaScript & VisualStudio is a bad idea. I would suggest using VisualStudio Code. So, while it's true that using this library will result in a compiler error message, you can still build apps that work (w/o any runtime errors). I really appreciate your thorough troubleshooting on this. We definitely need to document the above behavior/limitation. I suggest leaving this issue open until we've done that. |
Hi Guys, I had the same problem in Visual Studio building against the beta. Visual Studio seems to be pickier than other IDE's about being able to find modules at compile time. @davidkwong - You could set this is field in your tsconfig.json to have VS produce the javascript anyway
but then you lose the typescript goodness of trapping errors before runtime in my opinion. Then every time I'd add an esri module into load.ts I'd also include a fake class in the *.d.ts file. This keeps the VS compiler happy and you can import as per @jwasilgeo example. For example:
But...now that the v4 release is out and there's an actual arcgis-js.api.d.ts file. I can't get esri-system-js to work while using the correct .d.ts. Have just started looking at it really, so will raise another issue if I can't sort it out. |
If you use VS2015 in Windows 7, it looks like very picky but it works fine based in Windows 10 |
@Shawn-Fan, good to know. @nickcam, I like the ideas you raise in #7 for how to use the official d.ts files. I would like to try to get that working, but it will change the way this library works. What seems to me like the ideal quick fix would be if you could configure TypeScript to specifically ignore this error, but it seems that is not currently possible. I would encourage those on this thread that are affected by this issue to leave a comment on this issue to let the TypeScript team know that it would be helpful to enable the compiler to ignore specific errors. |
Hi Guys, |
@davidkwong, I tried same edition of your project in vs 2015 asp.net core 2, it works fine. Can you show both the "views/index.cshtml", and "views/shared/_layout.cshtml" ? |
Closing due to inactivity. |
Hello Team,
I am just trying to figure out how to use Esri System Js and Visual Studio ASP.NET Core for my backend.
After spend many days and hours I still not figure out why typescript cannot pick up the esri-mods module.
I can understand that the latest Javascript 4.0 api have no d.ts file at this point . How does typescript pick up the esri-systemjs module ? I am confused. What am I missing ? I use command line tsc the path toward to the tsconfig.json is having the same result. Typescript 1.8.10
Cannot find module 'esri-mods'
index.html
Load.ts
boot.ts
tsconfig.json
Package.json
The text was updated successfully, but these errors were encountered: