question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin suddenly cannot build typescript files or find names unless Sublime 3 is restarted

See original GitHub issue

Plugin works fine for a period of time, but after working for a while and changing/saving files, I notice all of the sudden some of my class names and other namespaces cannot be found. I can’t navigate to them with F12 (GoTo) and when I try to build a file, the compiler comes back with errors saying “Cannot find name InsertSomeNameHere

There appears to be no errors in the console once this happens. The only way to fix the issues is to shut down SublimeText and reopen it. After reopening Sublime, everything works as expecting and I can build all files that were open and also GoTo any name as normal. Some random time later, this happens again and I have to shutdown and restart the editor again.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:7
  • Comments:57 (36 by maintainers)

github_iconTop GitHub Comments

7reactions
kylebebakcommented, Apr 30, 2019

There are many things that cause tsserver to fail (adding a module, changing the component in a module from a class component to a function component, etc).

Fortunately, this cool plugin, https://github.com/randy3k/AutomaticPackageReloader, has a command for reloading any Sublime Text plugin.

Install AutomaticPackageReloader and add something like the following to User/Default.sublime-commands:

{ "caption": "Reload TypeScript Package", "command": "package_reloader_reload", "args": {"pkg_name": "TypeScript"} },

Or, to your sublime-keymap file:

{ "keys": ["super+ctrl+alt+t"], "command": "package_reloader_reload", "args": {"pkg_name": "TypeScript"} },

This reloads the TypeScript package, and in most every case I’ve seen makes it actually start working again in a second or two. This is a lot easier and faster than restarting Sublime Text.

@DanielRosenwasser @zhengbli It might be good to add this solution to the documentation. If this issue is any indication the plugin crashes frequently (it certainly does in my experience) and it seems like there’s no one able to fix the crash issues.

I’d be glad to add this to the docs and submit a PR if people think it’s worth it.

1reaction
it6commented, Mar 1, 2017

I experienced similar issues, but once I moved away from NVM and N and installed a single version of node this issue went away.

Update 3/1/17 It’s actually node version 4 that fixed this issue. Not sure if NVM or N has any role to play.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to compile TypeScript and run the result .js file in one ...
I've already successfully installed TypeScript plugin on Sublime Text 3. After the plugin is installed, it has a build system added to the...
Read more >
Ultimate Text Editing Productivity with Sublime Text | Ben Frain
Learn how to use Sublime Text like an expert! In this class you will learn all the incredible capabilities of Sublime Text and...
Read more >
Version History - CodeKit
3.9.2 fixes issues where TypeScript files failed to compile and npm packages with names shorter than 4 characters didn't show up in search...
Read more >
Modern IDEs are magic. Why are so many coders still using ...
I wish there was a modern vim. A minimal text editor with a scripting language and good plugins. but I don't want to...
Read more >
https://raw.githubusercontent.com/Microsoft/TypeSc...
TypeScript Plugin for Sublime Text ... If the `node_path` setting is present, this will override the PATH environment variable and the plug-in will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found