SS 4.6.1 Admin files Server responded with an error. Syntax Error: Unexpected <EOF> on live server

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe Version: 4.6.1

Admin files: Server responded with an error. Syntax Error: Unexpected

I have no problem with the admin area on my localhost (WAMP) but when I upload it to the server I get the error "Server responded with an error. Syntax Error: Unexpected " when I try to access the files in the admin area.
Btw, uploading files via an upload field on a page is possible, I just can’t see any file details either - same error message.

Has anybody any idea? What could be missing on the server?

To me it seemed completely unrelated, but the solution for this was to set the php memory in the root .htaccess file:

"php_value memory_limit 512M"

I hope that will help somebody else.