I just set up the default React/Redux application using visual Studio 2017 (File --> New Project -> ASP.NET core Web Application -> React/Redux. I made no edits to the created project. It runs on IIS Express fine, but when I go and look at the code, there's a bunch of red lines. It doesn't seem to recognize React/Redux syntaxs, as shown in the images below.
I looked around but couldn't find any packages or solutions to this problem. It makes it very hard to debug my code. Does anyone know of a fix? I don't want to use VS Code because it doesn't have resharper.
Edit: still not working. All node.js development packages are already installed.
Rename your .js files as .jsx files to fix this issue.
Related
I am currently working on a project with AngularJS, ASP.NET and TypeScript. The problem is to get TypeScript debugging working with the original file in VS 2015. Source-maps are created and loaded from the Browser, and the breakpoint hits, but not in the original file, but in a dynamic file, which has the same code as the original. It's very painful, because in the dynamic files, you don't have any data tooltips. I have installed the latest TypeScript MSBuild (2.2.1) from NuGet and the transpiling step is working. My source-maps, JS and TS files are on the same project hierarchy in VS and the source-maps look like this:
{"version":3,"file":"LinksController.js","sourceRoot":"","sources":["LinksController.ts"],"names":[],"mappings":"..."}
My hierarchy on the browser is vstatic/[MD5Hash of file]/[jsFile]. I have searched a lot in the web, tried something like changing the 'checking for new versions of stored pages' option in IE, that didn't work. I couldn't find any solution regarding TypeScript. I use IIS, IE11 and VS 2015 Update 3.
Thanks for your time!
I want to try my hand at a Cordova based mobile app. In Visual Studio's project templates, under Other Languages->JavaScript, there was an option to install the Cordova templates. I ran that, and after a lengthy install, the JavaScript template folder is gone, and there is a new TypeScript project template node, with one Blank App (Apache Cordova) template.
When I chose that template, I get an error message that says:
The template specified cannot be found. Please check that the full
path is correct
This is giving me the probably wrong impression that in VS2015, support for mobile development has only been given lip service, and there is probably a vast amount of DIY work required to get anything done.
What could be wrong that VS is telling me a template that it just installed is missing? I have a default setup of VS2015 with all default folder settings etc.
I had the same issue after installing update 2 of Cordova. I didn't want to do a 7gb update so I unchecked the Windows 10 related cross platform components as I was only interested in the Cordova update.
To fix the issue I installed all the options back into Visual Studio 2015.
I then received a new error when opening a Cordova Project. I looked in the ActivityLog of Visual Studio "SetSite failed for package [ApacheCordovaToolsPackage]"
To fix this issue I delete the ComponentModelCache of VisualStudio
"C:\Users[your user account]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache"
Using VS2013 Community Edition with Nodejs Tools for Visual Studio, the issue is that the intellisense for js files && classes is not working at all.
Dont have Resharper installed so it is not related to it.
I looked into text editor-> javascript -> auto list member is checked.
I also cannot add reference files to js files in a Project of type "From Existing Node.js Code" or "Blank Nodejs Web Application", also cannot create "_references.js" file neither through Web Essentials neither through Add -> Javascript Intellisense.
The project is front end running on node js.
Basically we use require js to load different modules (backbone : views, models etc ).
So as you see the intellisense it not working for this.getEmptyResponse.
https://trello-attachments.s3.amazonaws.com/54c0f5ffef5a644796f37cbc/851x222/4fb7e502f05f8b0ad01f2e58aee7241d/intellisense1.png
Also if i you require or define, it also doesnt show up anything.
And i cannot create javascript intellisense file either.
https://trello-attachments.s3.amazonaws.com/54c0f5ffef5a644796f37cbc/677x466/7e01ade2c13072a9ac8534ac90b7391d/intellisense2.png
Any help would be appreciated !!
I'm new to JS development and experience issues with debugging JS code in Visual Studio 2013. JS part of our web app is bundled into a single app.bundle.js file by WebPack, this file is automatically updated everytime any js file changes (we use special watch script which uses npm).
I'm able to debug JS code using Chrome and debugger; derecitve. It shows correctly mapped file under such kind of paths "webpack:///./Scripts/". It means that WebPack creates mapping correctly. But I'd like to debug directly from VS using Call Stack, break points, etc.
Any ideas?
Thanks in advance!
There is a a series of ongoing issues with Debugging webpack bundles Visual Studio. Depending on your webpack configuration and your dependency versions, this Webpack plugin may work for you. Be sure to check out the issues where can you see the ongoing conversation. If you are doing anything with Babel / ES2015+, you probably will want to upgrade to Visual Studio 2015 for syntax support.
I'm using Visual Studio 2013 to create an MVC5 application. I decided to use TypeScript for the client side. I have TypeScript installed and more or less configured. When I build the project JavaScript files appear next the TypeScript files (*.js and *js.map).
The problem is that those files are not included in the solution. I can only see them when I select "Show All Files" in Solution Explorer or browse my solution folder with file explorer.
I see 2 bad consequences:
When I add a .js file to a view like that <script src="~/Scripts/Custom/Tmp.js"></script> Resharper complains "Project file expected at XYZ". However when I run the MVC application JavaScripts work fine.
If the .js files are not included in the solution they won't be published and so the webpage won't work properly.
The only solution that comes to my mind is to add the files manually, but:
this sounds very tedious
I think the .js files are not being added for some purpose
What's the proper way to use TypeScript in an MVC application?
My experience so far with a project just like yours is unproblematic. After working with TypeScript so much, it's become painful to look at JavaScript!
Problem 1) doesn't happen in plain VS suggesting that the issue is with ReSharper.
Problem 2) isn't. Deployment works somehow; the .js files are published but the .js.map files are not.