Error occurs when trying to "open selected version"

In SourceTree, when attempting to open an old version of a file from the log view I get a Windows Script Host error. The file in question is a JavaScript file and the error details appear to indicate that SourceTree is attempting to execute the file, not open it.

"Error: 'goog' is undefined"

The first line of the file is a goog.provide() call and I am assuming this is causing the error.

3 answers

1 accepted

This widget could not be displayed.

SourceTree doesn't open files within itself, it launches whatever process is the operating system "default" for that filetype. On Windows, the default for .js files is usually to execute them.

If this isn't something you do (I've never known anyone to want that), you should be able to set your favorite editor as the default program for .js files to resolve the issue.

This widget could not be displayed.

I changed the default program in Windows and now it works great. Thanks for the tip!

This widget could not be displayed.

Ah, interesting. That makes sense it just didn't occur to me that it was based on the Windows default for some reason. I don't know why Windows would set the default to execute JS files...who would want that as the default?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

868 views 2 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you