Skip to content
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

"Cannot read property 'StopWatching' of undefined" #832

Closed
ActionCactus opened this issue Apr 7, 2019 · 22 comments
Closed

"Cannot read property 'StopWatching' of undefined" #832

ActionCactus opened this issue Apr 7, 2019 · 22 comments

Comments

@ActionCactus
Copy link

ActionCactus commented Apr 7, 2019

🐛 Describe the bug
When downloading

🌴 Visual Studio Code Version : 1.33.0
🌴 Code Settings Sync Version : 3.2.8
🌴 Standard or Insiders : Standard?
🌴 OSS or Portable : OSS?
🌴 Operating System : Win10
🌴 Occurs On: Download
🌴 Proxy Enabled: No
🌴 Gist Id: (irrelevant, tested with multiple valid and invalid tokens)

📰 To Reproduce
Steps to reproduce the behavior:

  1. Configure the provided gist to the sync.gist property in VS Code settings
  2. Open the command palette and run Sync: Download Settings
  3. See error in the title

💪 Expected behavior
A successful synchronization of settings or a more meaningful, user-facing error.

📺 Console Error Log

Error: Cannot read property 'StopWatching' of undefined
	at module.exports.t.Sync.<anonymous> (c:\Users\natko\.vscode\extensions\shan.code-settings-sync-3.2.8\out\extension.js:130:81409)
	at Generator.next (<anonymous>)
	at module.exports.n (c:\Users\natko\.vscode\extensions\shan.code-settings-sync-3.2.8\out\extension.js:130:76170)
	at new Promise (<anonymous>)
	at module.exports.n (c:\Users\natko\.vscode\extensions\shan.code-settings-sync-3.2.8\out\extension.js:130:75947)
	at module.exports.t.Sync.download (c:\Users\natko\.vscode\extensions\shan.code-settings-sync-3.2.8\out\extension.js:130:81292)
	at d._executeContributedCommand (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:477:621)
	at d.$executeContributedCommand (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:478:6)
	at d._doInvokeHandler (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:622:11)
	at d._invokeHandler (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:621:716)
	at d._receiveRequest (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:620:394)
	at d._receiveOneMessage (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:619:141)
	at define.constructor._protocol.onMessage.e (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:617:400)
	at u.fire (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
	at e (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:40:460)
	at u.fire (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
	at a (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:172:467)
	at e (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:172:513)
	at u.fire (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
	at y._receiveMessage (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:181:276)
	at define.constructor._socketDisposables.push._socketReader.onMessage.e (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:178:415)
	at u.fire (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
	at f.acceptChunk (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:175:35)
	at define.constructor._register._socket.onData.e (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:174:410)
	at Socket.t (c:\Users\natko\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:182:689)
	at Socket.emit (events.js:182:13)
	at addChunk (_stream_readable.js:279:12)
	at readableAddChunk (_stream_readable.js:264:11)
	at Socket.Readable.push (_stream_readable.js:219:10)
	at Pipe.onread (net.js:636:20)

📺 Additional context
I'm not well-versed in typescript and I don't know much about how async/promises work but the error occurs almost instantaneously after running the command which leads me to believe this is related to the globalCommonService.autoUploadService.StopWatching() call in Sync.download. I looked at the instantiation code and couldn't see anything obvious but perhaps the problem is there?

I originally installed 3.2.8 from the VS-Code Marketplace but it looks like the latest tag you have here is 3.2.7. I installed 3.2.7 specifically in VS Code and the problem doesn't exist there.

@shanalikhan
Copy link
Owner

shanalikhan commented Apr 7, 2019

@arnohovhannisyan

Can you look into this ?
I think we can release new version with this issue fix and alongwith that Mac related issue.

@auxves
Copy link
Contributor

auxves commented Apr 7, 2019

@shanalikhan sure

@auxves
Copy link
Contributor

auxves commented Apr 7, 2019

@ActionCactus Is this happening constantly, or did it only happen once?

@ActionCactus
Copy link
Author

It was constant and virtually instantaneous every time. I used multiple gists (in between resetting settings, of course) and tried with numerous code-sync settings (ranging from just a configured gist to multiple settings).

As mentioned in the bug report I did revert to 3.2.7 and the problem doesn't exist with that version.

@auxves
Copy link
Contributor

auxves commented Apr 7, 2019

Once I have a fix, will you be able to test it?

@ActionCactus
Copy link
Author

Yeah, sure

@RichieChoo
Copy link

I met it when I try to use shift +alt + U to set Token

Cannot read property 'StopWatching' of undefined

@auxves
Copy link
Contributor

auxves commented Apr 8, 2019

@auxves
Copy link
Contributor

auxves commented Apr 8, 2019

@eojina If you are getting errors, create an issue and show the error. This way it can get fixed, and you won't get annoyed.

@ActionCactus
Copy link
Author

@arnohovhannisyan This appears to be working, but I may have more info for you.

To test the attachment you gave me I reset extension settings for code-sync and then uninstalled the extension. After that I reinstalled the extension from scratch and simply ran "Sync: Download Settings" without setting up a gist (previously this was a scenario which would trigger the error filed). Things worked fine...When I filed the issue I had only just installed code-settings-sync on this machine for the first time (having installed elsewhere before). Could the issues be related?

Of course when I installed the package you gave me (code --install-extension .\code-settings-sync-3.2.8.vsix) things worked perfectly again. It seems you've resolved the issue; thank you so much!

@auxves
Copy link
Contributor

auxves commented Apr 8, 2019

@ActionCactus I'm glad it worked, and thanks for testing!

Could the issues be related?

I'm pretty sure that this just had to do with the auto-upload service being instantiated after the call.

@auxves
Copy link
Contributor

auxves commented Apr 8, 2019

@shanalikhan I made a PR fixing this issue.

@shanalikhan shanalikhan added this to the v3.2.9 milestone Apr 8, 2019
@mvilks
Copy link

mvilks commented Apr 9, 2019

After that I reinstalled the extension from scratch [..]

I can confirm that a simple reinstall (uninstall, reload app, install extension again) fixes the problem.

shanalikhan pushed a commit that referenced this issue Apr 9, 2019
* Use handler methods to check if autoUploadService exists

* Update incorrect function call

* Use await before calling handlers
@ericconstantinides
Copy link

ericconstantinides commented Apr 9, 2019

I just manually restarted VS Code and it fixed this issue. Didn't have to uninstall or reinstall or anything exotic like that.

@dragonwocky
Copy link

Can confirm: fresh install of VS Codium (VS Code without Microsoft's modifications), downloaded shan.code-settings-sync, hit CTRL + ALT + U, and got "Cannot read property 'StopWatching' of undefined". Manually relaunched the app, hit CTRL + ALT + U, and extension started behaving as expected (asked for GitHub Personal Access Token).

@linq8261
Copy link

I just manually restarted VS Code and it fixed this issue. Didn't have to uninstall or reinstall or anything exotic like that.

it work after restarted.

@qqqasdwx
Copy link

qqqasdwx commented Apr 12, 2019

Name: Settings Sync
Id: shan.code-settings-sync
Description: Synchronize Settings, Snippets, Themes, File Icons, Launch, Keybindings, Workspaces and Extensions Across Multiple Machines Using GitHub Gist.
Version: 3.2.8
Publisher: Shan


I have a same problem,and I try this:

@ActionCactus你可以尝试一下吗?https://cdn.discordapp.com/attachments/549007146868539408/564659165088448534/code-settings-sync-3.2.8.vsix

but it doesn't work. I get same result.

@sattellite
Copy link

Have the same problem on new installation. After VSCode have been restarted problem was resolved.

@KeithBarrows
Copy link

Same problem. Restart of VSCode fixed it with the 3.2.8 build already installed.

@ChildishGiant
Copy link

I've just installed and got this error too. Restarting seemed to have solved this.

@elliot-huffman
Copy link

I got this issue too, I was setting up for the first time ever and it threw an error like this. I was using VS Code 1.33.1.
I was able to do the worksournd where I uninstall, reload and re-install and it resolved it for me.
Restarting the app didn't help me.

shanalikhan pushed a commit that referenced this issue Apr 18, 2019
* Use handler methods to check if autoUploadService exists

* Update incorrect function call

* Use await before calling handlers
@shanalikhan
Copy link
Owner

Released v3.2.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests