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

2 votes
Accepted answer

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.

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

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 Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,123 views 4 2
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