Hugo powered page returns empty JS file

Hello, I am trying to wrap my head around an issue with an empty JS file returned from netlify server. Details:

When I build a project locally I have js/academic.min.bcfae8267aba63cc55af53a503896bd9.js with it’s all code.

Netlify deploy log doesn’t have errors or warnings, I tried “clear cache and deploy option several times”

1:22:59 PM: Build ready to start
1:23:00 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
1:23:00 PM: build-image tag: v3.3.5
1:23:00 PM: buildbot version: 94178e8d3e0dd79630813c690b9aae771c4d9605
1:23:00 PM: Fetching cached dependencies
1:23:00 PM: Starting to download cache of 254.9KB
1:23:00 PM: Finished downloading cache in 93.101031ms
1:23:00 PM: Starting to extract cache
1:23:00 PM: Failed to fetch cache, continuing with build
1:23:00 PM: Starting to prepare the repo for build
1:23:01 PM: No cached dependencies found. Cloning fresh repo
1:23:01 PM: git clone
1:23:02 PM: Preparing Git Reference refs/heads/master
1:23:03 PM: Found Netlify configuration file. Overriding site configuration
1:23:03 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'hugo --gc -b $URL' versus 'hugo --gc --minify' in the Netlify UI
1:23:03 PM: Starting build script
1:23:03 PM: Installing dependencies
1:23:05 PM: v10.17.0 is already installed.
1:23:05 PM: Now using node v10.17.0 (npm v6.11.3)
1:23:06 PM: Attempting ruby version 2.6.2, read from environment
1:23:07 PM: Using ruby version 2.6.2
1:23:07 PM: Using PHP version 5.6
1:23:07 PM: Installing Hugo 0.58.0
1:23:09 PM: Hugo Static Site Generator v0.58.0-64D8BF1E/extended linux/amd64 BuildDate: 2019-09-04T15:49:24Z
1:23:09 PM: Started restoring cached go cache
1:23:09 PM: Finished restoring cached go cache
1:23:09 PM: unset GOOS;
1:23:09 PM: unset GOARCH;
1:23:09 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
1:23:09 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
1:23:09 PM: go version >&2;
1:23:09 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
1:23:09 PM: go version go1.12 linux/amd64
1:23:09 PM: Installing missing commands
1:23:09 PM: Verify run directory
1:23:09 PM: Executing user command: hugo --gc -b $URL
1:23:09 PM: Building sites …
1:23:09 PM:                    | EN
1:23:09 PM: +
1:23:09 PM: ------------------+----+
1:23:09 PM:   Pages            | 39
1:23:09 PM:   Paginator pages  |  0
1:23:09 PM:   Non-page files   |  1
1:23:09 PM:   Static files     |  7
1:23:09 PM:   Processed images |  1
1:23:09 PM:   Aliases          |  6
1:23:09 PM:   Sitemaps         |  1
1:23:09 PM:   Cleaned          |  4
1:23:09 PM: Total in 359 ms
1:23:09 PM: Skipping functions preparation step: no functions directory set
1:23:09 PM: Caching artifacts
1:23:09 PM: Started saving pip cache
1:23:09 PM: Finished saving pip cache
1:23:09 PM: Started saving emacs cask dependencies
1:23:09 PM: Finished saving emacs cask dependencies
1:23:09 PM: Started saving maven dependencies
1:23:09 PM: Finished saving maven dependencies
1:23:09 PM: Started saving boot dependencies
1:23:09 PM: Finished saving boot dependencies
1:23:09 PM: Started saving go dependencies
1:23:09 PM: Finished saving go dependencies
1:23:11 PM: Build script success
1:23:11 PM: Starting to deploy site from 'public'
1:23:11 PM: Creating deploy tree 
1:23:11 PM: Starting post processing
1:23:11 PM: 0 new files to upload
1:23:11 PM: 0 new functions to upload
1:23:12 PM: Post processing done
1:23:12 PM: Site is live
1:23:24 PM: Finished processing build request in 24.197823186s

Sorry to be slow to get back to you!

I do see the empty JS file and I can’t say how it happened exactly.

But heres how to debug:

That way you can see what our build creates and debug in place instead of trying to debug by looking at what we produce.

Please be sure to start with a clean checkout of your repo (not the one you’ve been using locally).