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

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.

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?

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

791 views 0 4
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