Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

HML5 compressed files- SyntaxError: illegal character

I'm getting this error when I try to run from my website -

SyntaxError: illegal character SyntaxError: illegal character SyntaxError: illegal character

My host is hostgator - the page works on 000webhost though. I tried to include a htaccess file with

AddType "text/javascript" .gz AddEncoding gzip .gz

EDIT: So the uncompressed files work fine - I changed the const serveCompressedAssets to false - how can I get it running with the compressed files? But still get the same error. Any ideas?

Shot of my files - I included everything to see if that might work. alt text

Product Version: UE 4.18 Preview
host.png (30.3 kB)
more ▼

asked Oct 07 '17 at 04:14 PM in Packaging & Deployment

avatar image

51 7 14 22

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

If you get the Illegal Character error, it very likely means that the file was still getting served without "Content-Encoding: gzip" flag, so it sounds like the htaccess file was not getting used. You can verify that by using the Network tab of Firefox Developer Tools, in particular the Headers view of the request (see https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor#Headers). That list should show "Content-Encoding: gzip" present in the "Response headers" section, next to Date, Content-Type, Content-Length and so on.

You can cross-reference by using the Network details tab on the page http://mzl.la/webassemblydemo, which does use gzip compression with the served files (that one is hosted with Amazon AWS S3 service)

more ▼

answered Oct 08 '17 at 09:45 AM

avatar image

1.2k 15 4 17

avatar image Donalf Oct 09 '17 at 06:06 PM

.htaccess isn't appearing in the network tab- I've looked at it in Firefox and Chrome and can't see htaccess in the tab. I don't actually see htaccess for the demo either though but it is loading .gz files.

alt text

network.png (39.5 kB)
avatar image juj Oct 10 '17 at 11:31 AM

Amazon AWS S3 does not use .htaccess files to specify Content-Encoding, rather it has its own Metadata-based system (http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html).

Iiuc .htaccess is a Apache web server specific configuration file.

avatar image Donalf Oct 10 '17 at 01:29 PM

Ah I see.. HostGator uses Apache, so I'm not sure what I'm doing wrong - seems like .htacess should be fine to modify http://support.hostgator.com/articles/-htaccess-guidance

What it could be is UE4 provides a htacess file, and hostgator creates one for a website by default. Maybe I've overwritten the default with the UE4 one and there's something necessary in the default. I'll see if I can find the original.

EDIT: I used the original but it still doesn't seem to be loading in the network tab

avatar image Donalf Oct 10 '17 at 04:02 PM

I've been talking to my hosting company's tech service but they coudn't figure it out. I tried compressing everything in the filehost but get the same problem. It does look like this used to be pretty common but none of the solutions so far seem to work. What should actually be contained in the htaccess file?

avatar image juj Oct 11 '17 at 05:17 PM

I don't know if the needed contents of .htaccess file can vary per hosting server (e.g. if Apache is configured differently, or different Apache versions), but looking at project files from one UE4 project that did use .htaccess with Apache, it seems to have the following in it:

 AddType application/x-javascript .jsgz    
 AddType application/octet-stream .datagz
 AddType application/wasm .wasm
 AddType application/wasm .wasmgz
 RewriteEngine on 
 # If client accepts compressed files 
 RewriteCond %{HTTP:Accept-Encoding} gzip 
 # and if compressed file exists 
 RewriteCond %{REQUEST_FILENAME}gz -f 
 # send .extgz instead of .ext 
 RewriteRule ^(.+)\.(mem|js|data|symbols|wasm)$ $1.$2gz
 AddEncoding gzip .jsgz 
 AddEncoding gzip .datagz
 AddEncoding gzip .memgz
 AddEncoding gzip .symbolsgz
 AddEncoding gzip .wasmgz

Though I have not tested or deployed this project in practice to verify it first hand.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question