If "bash <file>" works, why is "source <file>" throwing an error?
However, when you source something, it is run in your current shell which, because it is interactive, has already loaded the aliases and therefore the fi alias is recognized and breaks the