Skip to content

Can't edit files in Visual Studio after installing 1.8.4 On Update 2 CTP #7204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
OSUblake opened this issue Feb 24, 2016 · 113 comments
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority

Comments

@OSUblake
Copy link

TypeScript Version:
1.8.4

Visual Studio Version:
Community 2015 CTP 14.0.25008.00

Everything was working fine using TypeScript 1.8.1 beta. After installing 1.8.4 last night, the editor no longer works. Typing does nothing. The onlys keys it responds to are enter, delete, backspace. The three drop-down lists at the top of the editor that let you jump to certain parts of your code are all blank.

I've tried all of the following with no luck.

  • Repair/uninstall Visual Studio and TypeScript
  • Disable extensions
  • Uninstall ReSharper
  • Clear MEF component cache
  • Update devenv.exe.config

I also can't seem to stop Visual Studio from updating to the CTP when I reinstall. I started getting a lot of JavaScript language service crashes after installing the CTP. Viewing a compiled TS file would cause JavaScript to stop working.

@djarekg
Copy link

djarekg commented Feb 24, 2016

I have the same problem. My co worker does not and the only major difference is I have the vs2015.2 CTP and he just has vs2015.1 rtm. Hope that helps

@birick
Copy link

birick commented Feb 24, 2016

I ran into the same problem as well.

I was playing using the newly added ability to add comments to the tsconfig.json file. If I added a comment at the very top of the file, then this behavior occurred after a restart of VS.

To resolve, remove any comments at the top of the tsconfig.json file (only use inline comments to the json), and then restart VS. To be safe, you might try removing any comments to the file and restarting VS and see if that fixes it.

@mhegazy mhegazy changed the title Can't edit files in Visual Studio after installing 1.8.4 Can't edit files in Visual Studio after installing 1.8.4 On Update 2 CTP Feb 24, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Feb 24, 2016

Update 2 CTP does not support TS 1.8.4. We are looking into why the setup did not show the correct blocking message.
TS has dependency on internal APIs that changed in Update 2, trying to install TS 1.8.4 (targeting Update1) will cause the language service to be broken.
Update 2 CTP has TS 1.8.1-beta in box, the next public release of Update2 should have the TS 1.8.4. sorry for the inconvenience.

@mhegazy mhegazy added Bug A bug in TypeScript High Priority labels Feb 24, 2016
@mhegazy mhegazy modified the milestone: TypeScript 2.0 Feb 24, 2016
@IanYates
Copy link

@mhegazy - thanks for the update. Partly our fault for running a CTP :) The perf improvements have been worth it though.

If you've got some hacky way of rolling back to the 1.8.1-beta that'd be splendid.

@mhegazy
Copy link
Contributor

mhegazy commented Feb 24, 2016

uninstall TS 1.8.4, repair Update 2 entry in Add/Remove programs should do the trick.

@IanYates
Copy link

Despite having Update 2 CTP installed, my Add/remove programs just shows
Microsoft Visual Studio Enterprise 2015 with Update 1
capture1

But CTP for update 2 was definitely installed and indeed when I run VS 2015 it says it's CTP for update 2
capture2

I guess the incorrect info being reported in add/remove programs is the reason why installation of TypeScript 1.8.4 wasn't blocked.

So I've uninstalled TS 1.8.4 - it was really quick and then repaired the only VS2015 entry (update 1) in add/remove programs so I no longer get those crashes in VS pointing me to the activity log but I also get a read-only TypeScript editing experience.

Sorry for so many words - I wanted to be specific and anticipate what you might suggest :) My other thread has the things I've tried already with regards to uninstall, reinstall, repair, etc.

@IanYates
Copy link

I went to my layout folder for the update 2 CTP and found the pair of Typescript *.msi files. They wouldn't install as a newer version of the product was already present. Removing TypeScript 1.7.x and 1.8.x from add/remove programs still didn't let the *.msi files executes.

So I then fired up Windows Installer Cleanup Utility. It lists many packages for CTP update 2 - so that's good. It also still listed the TypeScript packages. I nuked them and then ran the ones from the update 2 ctp folder.

That got me back to VS 2015 throwing errors directing me to the activity log upon opening a TypeScript file.

I visited add/remove programs and removed TypeScript from there. Opening VS 2015 got me back to the behaviour described in this thread where I get the read-only TypeScript experience (but no errors raised in the GUI). Strange that even after uninstalling TypeScript I still got syntax highlighting, etc.

I'm now running a full repair from the VS 2015 Update 2 CTP installer. Fingers crossed.

@IanYates
Copy link

🙅
Reboot after repair and it's still read-only. I noticed however that I can cut & paste code to the editor. Saving doesn't recompile the JS files though.

I'm heading home (GMT + 10 here) and will check this thread again in an hour or two. I have some work to do tonight so am very happy to be a guinea pig for any suggested fixes you may have.

@OSUblake
Copy link
Author

uninstall TS 1.8.4, repair Update 2 entry in Add/Remove programs should do the trick.

Unfortunately, this does not resolve the issue. Everything @IanYates has posted is the same for my machine. There is no Update 2 entry in Add/Remove programs, and Visual Studio is still showing 1.8.4 as being installed.

Testing out all these different repairs takes way too long. At this point, I'm beginning to think that doing a clean install is going to be the easiest fix for me.

@IanYates
Copy link

I've uninstalled, reinstalled, uninstalled, gone crazy... 🔥

I have run uninstallers for VS 2015 Update 1 from add/remove programs and then also ran the installer for Update2 CTP to ask it to remove itself. Rebooting in between every change.

I tried just VS 2015 update 1, which claims to mostly work (some TFS component fails) but then I can't apply the servicing update for update 1 since it says it needs update 1 installed. TypeScript files open but with no syntax highlighting or any other special behaviour. Whilst VS doesn't talk about being a CTP in its splash screen it's help->about menu still mentioned CTP 2.

So I figured I might as well try to get on to Update 2 CTP. It installs without complaint. Reboot.

But now I'm back to square one - I can't edit any typescript files :(

How can I completely remove TypeScript from my system so that I can perhaps run the 2x TypeScript MSIs that ship with Update 2's CTP? I assume there are registry keys and folders to remove. I just don't want to remove too many and break things further.

@paulvanbrenk
Copy link
Contributor

Can you delete the component cache [0] and the activity log from your machine... and send me the activitylog.xml [1] when it's created again?

And what's the version of the TypeScript language service assembly [2].

[0] %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache
[1] %AppData%\Microsoft\VisualStudio\14.0
[2] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript\Microsoft.VisualStudio.LanguageServices.TypeScript.dll

@OSUblake
Copy link
Author

@paulvanbrenk -TypeScript language service version: 14.1840.40222.1

ActivityLog.txt

@paulvanbrenk
Copy link
Contributor

Can you nuke this folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript\ and re-run the update 2 installer from here https://www.visualstudio.com/en-us/downloads/update2-prereleases

@paulvanbrenk
Copy link
Contributor

@OSUblake just to make sure, did you open a TypeScript file before grabbing the activitylog? I don't see any errors in there, which is a unexpected.

@OSUblake
Copy link
Author

I was wondering if that's what you wanted to happen, but I had to manually log that out.

After doing a repair and clearing the component cache, it stops creating errors when you launch VS, even though it's not working correctly.

@paulvanbrenk
Copy link
Contributor

@OSUblake did you try clearing the TypeScript folder and re-running the Update 2 installer.. not repair from 'Programs and Features'...

I'm setting up a machine to see if I can get it in the same state... but that's taking a little while.

@OSUblake
Copy link
Author

I'm not near my computer right now, but I'll try again using the steps you provided.

I did try running the installer before, but it would always crash as soon as I pressed install. For some reason using the installer from the Visualstudio.com site would always cause it to crash, but the installer from the Microsoft.com downloads worked.

@IanYates
Copy link

I've just gone through the nuking of folders and am about to try the typescript installer. I should add that I had the same TS language file version as reported by @OSUblake above

@IanYates
Copy link

vs 2015 ctp 2 setup result
(Note that it says update 1 in the image but I fetched and ran the installer at https://www.visualstudio.com/en-us/downloads/update2-prereleases clicking the web installer link)

Setup log
dd_vs_enterprise_20160225070059.log.txt

After launching VS it's still broken I'm afraid. No user visible errors. I can open a TS file and get syntax highlighting but I can't type.

Unfortunately there's now no activity log file. Weird. (I did delete the XSL stylesheet for it by accident - maybe that had an effect). I'll rerun with the -log parameter.

@IanYates
Copy link

Version of typescript is now 1.8.0. VS 2015 version is update 2 CTP 14.0.25008.00

The folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript\ is no longer on my PC so I can't check the language file version in that folder.

BUT, it is in the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\VWDExpressExtensions\TypeScript folder now.
Version: 14.1840.40222.1

Activity log...
typescriptactivity.txt

Screenshot of help->About
vs and typescript version in help-about

@IanYates
Copy link

A better activity log. I realised that I renamed TypeScript folder to _TypeScript and could see in the previous log that VS enumerates all folders for extensions and found the _TypeScript folder. It's now completely nuked.

So rerunning VS again gives me a TypeScript editor where I can type but
a) I do get an activitylog.xml file and a message telling me to go look at it
b) Saving the TS file does not recompile the JS file anymore

Activity log attached
ActivityLog.xml.txt

@paulvanbrenk
Copy link
Contributor

You probably saw this message:

image

Now I see TypeScript files as plain text files.. but no TypeScript features work.

Uninstall of 1.8.4 from the Programs and Features dialog runs into an issue, where the 1.8.4 components depend on the 1.7.6 components....

Trying some things to get the correct TypeScript bits on my machine. I'll let you know.

@IanYates
Copy link

Thanks @paulvanbrenk - I appreciate the help.

@maggiepint
Copy link

.tsx - typo there.

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "jsx": "preserve"
  }
}

@maggiepint
Copy link

There's absolutely nothing proprietary, it's just junk code, so I pushed the whole repo:

https://github.com/maggiepint/ReactTSBehavingWeird

@CarlosOnline
Copy link

I had to create a batch file to workaround this.

move tsconfig.json tsconfig.json.bak

REM start typing in the visual studio typescript file then un pause the this script to keep gulp happy

pause

move tsconfig.json.bak tsconfig.json

@teves-castro
Copy link

@CarlosOnline Can you elaborate on how exactly are you using your solution?

In my case after I rename the tsconfig file I regain editing ability, but when when the file is renamed back to its original name although I retain editing ability the project system is no longer using the tsconfig file and instead is looking at the project as if no tsconfig is present in the project.

Note: I'm using an ASP.Net 4.6 project not a ASP.Net Core one.

@CarlosOnline
Copy link

I make sure to restore tsconfig before typescript file is saved, otherwise gulp will fail.

@bitsagarob
Copy link

After get latest with tfs I cant edit any typescrit files anymore. Turned source control plugin on and off, changed nothing in the tsconfig file, reboot and can still edit .js and .html files but no .ts files. unable to work

@teves-castro
Copy link

In my case I was able to overcome my problems by removing some content from my tsconfig.json file. More specifically I had a filesGlob element and a files element in my file, which weren't being used, my project builds with gulp and the source files are specified in another form. After removing these elements everything started working normally.
This leads me to believe that this problem might have something to do with some invalid content in tsconfig preventing the language service to operate properly.

@paulvanbrenk
Copy link
Contributor

paulvanbrenk commented May 4, 2016

@segersrobbert If you remove the tsconfig.json does editing work again... can you share your project?

Further can you share your %appdata%\Microsoft\VisualStudio\14.0\ActivityLog.xml if it contains any errors. Thanks!

@bitsagarob
Copy link

I've upgraded visual studio and all works fine now. I'm sorry to say it's been a real struggle working with visual studio on front-end work besides this edit bug, configuring own compiling of typescript was a real hassle, its slow, it freezes and crashes quite often.

@mhegazy
Copy link
Contributor

mhegazy commented May 5, 2016

configuring own compiling of typescript was a real hassle, its slow, it freezes and crashes quite often.

@segersrobbert sorry to hear you are running into trouble there. We would love to get these issues fixed. Can you share more information about your set up, how can we reproduces the crashes, and freezes? can you share crash dumps, or at least stacks from relevant error events in your event viewer?

@bitsagarob
Copy link

Setup: mac(10.11.4) running parallels with windows10, since updated to VS2015 update 2 crashes and freezes are no more. VS is still interfering with typescript compiling and adding its typescript compile tags to csproj whenever it feels like.

@mhegazy
Copy link
Contributor

mhegazy commented May 11, 2016

VS is still interfering with typescript compiling and adding its typescript compile tags to csproj whenever it feels like.

adding a new typescript file will always add it as TypeScriptCompile item.

@mhegazy
Copy link
Contributor

mhegazy commented May 11, 2016

VS is still interfering with typescript compiling

can you elaborate on this? what is the expectation and what is actually happening?

@vanister
Copy link

vanister commented Jun 7, 2016

As soon as I reintegrate the tsconfig.json file in the project, it breaks the .ts editor. And likewise, as soon as i remove it from the project, the editor starts working again.

I ran into a similar issue to @cboulva, except my .ts files would only be editable when I added the tsconfig.json (default one from Add > New Item context menu) file back to my project.

I initially used VS to compile my .ts files, but then switched to using gulp for compiling them. That's when I deleted the tsconfig.json file, restarted VS the following day, then ran into the non-editable .ts files. Of course, adding it back made it work.

I also added the <TypeScriptCompileBlocked> line to my .csproj file to prevent msbuild from compiling the .ts files in my project.

    ....
    <TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>

@paulvanbrenk
Copy link
Contributor

@vanister can you share your project?

@vanister
Copy link

vanister commented Jun 7, 2016

@paulvanbrenk sure, how do you want me to get it to you?

@paulvanbrenk
Copy link
Contributor

@vanister A repo on GitHub is probably easiest. Also, which version of VS and TypeScript are you using ( see Help - About).

@vanister
Copy link

vanister commented Jun 7, 2016

@paulvanbrenk I'll create a repo for it and send you the details. I'm using 2015 update 2 with TypeScript 1.8.31. Whatever was installed with the VS update 2 installer. I am also using gulp-typescript and that typescript version is:

$ node_modules/gulp-typescript/node_modules/typescript/bin/tsc -v Version 1.8.10

image

@vanister
Copy link

vanister commented Jun 7, 2016

@paulvanbrenk sent you and email

@paulvanbrenk
Copy link
Contributor

paulvanbrenk commented Jun 7, 2016

@vanister change the following in your project files:

-    <TypeScriptTarget>Unknown</TypeScriptTarget>
+    <TypeScriptTarget>ES6</TypeScriptTarget>

We don't gracefully deal with that, this will be fixed in the next release of TypeScript

@vanister
Copy link

vanister commented Jun 8, 2016

Thanks @paulvanbrenk

@kabua
Copy link

kabua commented Jun 13, 2016

I think I found the Issue!
I just ran across the same problem BUT I think I've tracked down the issue.

If I have a very simple project; which contains only a single ts file and a tsconfig.json file then I can edit the ts file. However, if I include the project's node_modules folder (which contains Angular2's QuickStart required modules - consists of 5,610 files) then I can't edit the ts file; well not for a few seconds that is.

On future investigation, I discovered that when I couldn't edit the ts file, the three drop-down list boxes were empty. But then after several seconds, I noticed that the first drop-down list box would finally show "TypeScript Virtual Projects" at which point, I could edit my ts file!!

By changing my tsconfig.json file to exclude the node_modules folder, I could edit my ts almost instantaneously.

My test tsconfig.json file:

{
    "compilerOptions": {
        "target": "es5",
        "module": "system",
        "moduleResolution": "Node",

        "declaration": false,
        "diagnostics": true,
        "removeComments": false,
        "sourceMap": true,
        "listFiles": true
    },

    "exclude": [
        "WebUtilities",
        "node_modules",
        "typings"
    ],

    "compileOnSave": true
}

Can anyone else verify that this fixed the issue?

@paulvanbrenk
Copy link
Contributor

@kabua that sounds very plausible.. I'll update the default tsconfig.json file to exclude node_modules and bower. Are there any other suggestions?

@natwebb
Copy link

natwebb commented Jun 14, 2016

I am running into the same issue, and none of the fixes suggested here seem to be working. My .tsconfig has always excluded node_modules, so I can't add it pursuant to @kabua 's suggestion, so presumably that's not universally the cause of this issue. I tried adding and removing .bak on the .tsconfig and that also has made no difference. I'm compiling .ts into .js using VisualStudio, and not running gulp or any other such tool.

I have a question out on Stack Overflow here: http://stackoverflow.com/questions/37820711/visual-studio-2015-cannot-edit-typescript-files-get-exception-0x80020101 and I'm happy to share any other information that may be useful, though I can't upload the project itself without getting fired. :)

@paulvanbrenk
Copy link
Contributor

@natwebb Yeah, this looks like a different issue.. replied on the StackOverflow question.

@natwebb
Copy link

natwebb commented Jun 17, 2016

At the suggestion of @paulvanbrenk I intalled Update 3 RC from here: https://www.visualstudio.com/downloads/visual-studio-prerelease-downloads and while the initial install failed, necessitating a restart and making VS unusable, running a Repair to get VS back up and running included a successful install of Update 3 RC and fixed the bug!

@Schoof-T
Copy link

Schoof-T commented Jul 4, 2016

I started receiving this error after I updated to Update 3 (Final). I made a stackoverflow question about this issue: http://stackoverflow.com/questions/38184024/error-in-visual-studio-2015-update-3-when-opening-solution-typescript

@IvanMisyats
Copy link

I was able to edit Typescript files again when I installed Update 3 for VS.

@morsmodr
Copy link

morsmodr commented Jan 27, 2017

Close VS2015.
In the root of your solution, go to .vs folder > folder named with solution name > v14 folder > delete the hidden file (Type: Visual Studio Solution User Options)
Restart VS2015
Voila it works
The one caveat is that the files you had open while working earlier are not open

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority
Projects
None yet
Development

No branches or pull requests