Having trouble deploying (too many files, etc.)

We are trying to deploy our first Needle Engine project, but are having trouble.

The first failure came in failing to push to Needle Cloud. When we turn on “Auto Compress” and then try to run Needle Engine locally, there are more than 1,000 files generated in our assets folder, and all of them appear to be LOD GLB files. Needle Cloud won’t let us publish that many files there.

Then we tried the GitHub deployer, and we got the error, “Not allowed to use Gzip.” Not sure how/where we turned that on, and we can’t figure out how to turn it off.

We now have hosting on DigitalOcean, but we’re unable to deploy there. The way you guys are doing SFTP doesn’t map on to how we normally do SFTP. We use SSH key-based auth for SFTP. It would be nice if this could be normalized to present password as optional and either let the user specify their SSH key or just use the system’s default.

So ultimately, we used the build window to build to disk without gzip compression and uploaded manually. Incidentally, the documentation for “Build To Folder” is out of date.

Relatedly, if you guys could provide the specific NGINX config entries that allow for serving pre-compressed files, that would be awesome. We tried several different approaches, and none of them seemed to work.

Thank you!

Hi Aaron, thanks for reaching out. Here’s a rundown addressing each of your issues:

  1. Auto Compression & Too Many LOD Files
    When “Auto Compress” is enabled, the build process creates separate GLB files for each LOD level in your scene. This can lead to over a thousand files if your scene uses many LODs. In this case, you can either disable auto compression (if those extra files aren’t needed) or adjust your LOD settings to reduce the number generated. For now, if you want to deploy via Needle Cloud, using a manual “Build To Folder” may be your best bet until we fine-tune this behavior (see our deployment docs (docs/deployment.html)).

  2. GitHub Deployer “Not allowed to use Gzip” Error
    This error generally appears when gzip compression is still active in your build. You can disable it by unchecking the gzip option in the Needle Engine Build Window or by removing the gzip plugin (typically in your vite.config.js, e.g. removing or commenting out the line with viteCompression). That should prevent the deployer from trying to use gzip (reference our guidance on disabling gzip (docs/deployment.html)).

  3. DigitalOcean SFTP & SSH Key–Based Authentication
    At the moment, our SFTP deployer expects password-based authentication. Since you’re using SSH keys, the recommended workaround is to build to folder without gzip compression and then manually upload using your SFTP client (which supports your key-based auth). We appreciate your feedback here and will look into normalizing this in a future update.

  4. NGINX Config for Serving Pre-Compressed Files
    To serve pre-compressed files with NGINX, a common configuration snippet is as follows:

nginx
server {
    listen 80;
    server_name yourdomain.com;

    # Enable serving pre-compressed (.gz) files if they exist
    gzip_static on;
    location / {
        try_files $uri $uri.gz $uri/ =404;
    }
}

This setup tells NGINX to first check for a corresponding .gz file and serve it when appropriate. Make sure that your build process outputs correctly named pre-compressed files and adjust additional gzip settings (or disable gzip if necessary) to avoid double compression (see our deployment documentation (docs/deployment.html)).

I hope this helps clear things up. Let me know if you have further questions or need additional details.

1 replies left - Become PRO for more replies.
thread_KRjCNjqFS7fDTaNQqE32KCkk
Reply to this post directly if you need further help (bottom right button)

Hello @Aaron_Collegeman

sorry for the inconvenience. Do you the exact number for me how many files are being generated for uploading?

Needle Cloud: I believe the limit of 1,000 files is an oversight and should be removed - I will check and get back to you later today.

Github: When you click on the Build & Deploy button it will automatically build with gzip turned off for that reason. You might just have clicked on Deploy since you already had a finished build (gzipped)? In which case the deployment fails - I’ll make sure to add another check that this button won’t be enabled if it detects gzipped assets. That being said: Uploading that many assets to Github pages is probably not recommended since it might violate Github TOS.

SFTP: Will create an issue for this for now and discuss with the team.

I’ll make sure we also update the documentation. The Needle Build window is now a separate window and can be opened via File/Needle Engine/Build Window or the Needle Engine component’s All Build Targets button.

@Aaron_Collegeman We increased the Needle Cloud file limit. Let me know if you still run into this issue when you try to deploy to Needle Cloud.

The Build to Disc docs have been updated as well. Thanks for pointing it out.

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.