Web Builds do run on Itch.io (Solved- use distclean between builds)

Hi all, while web builds compile locally and work , I’m getting this error in the JS console on itch.io

Uncaught RuntimeError: Aborted(Assertion failed: g_Window, at: …/src/platform_window_glfw.cpp,79,OnWindowFocus). Build with -sASSERTIONS for more info.
at abort (:286:11)
at ___assert_fail (:528:3)
at 00a9df36:0x16bba6
at Object.onFocusChanged (:8584:40)
at HTMLCanvasElement.onBlur (:8591:10

Here’s the Github build file I 'm using

name: Build and Deploy

on:
  push:
    branches:
      - main  # Trigger on pushes to the main branch
  pull_request:
    branches:
      - main

jobs:
  build-android:
    environment: web
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      
      - name: Setup Defold
        uses: dapetcu21/setup-defold@v3.0.3
        with:
          version: '1.8.0'  # Ensure you use the version you need

      - name: Set up Java
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'  # Eclipse Temurin is a popular choice
          java-version: '17.0.11+9'  # Java 11 is commonly used with Android

      - name: Prepare environment
        run: |
          echo "NEW_VERSION_CODE=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
          echo "NEW_VERSION_NAME=1.0.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV

      - name: Build project for Android
        run: |
          keytool -genkeypair -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 -storepass android -keypass android -dname "CN=Android Debug,O=Android,C=US"
          java -jar $BOB --platform armv7-android --variant debug --bundle-output ./build/android --keystore=./debug.keystore --keystore-alias=androiddebugkey --keystore-pass=android.txt --bundle-format=apk --archive resolve build bundle
          java -jar $BOB --platform js-web --variant debug --bundle-output ./build/html5 --archive resolve build bundle

        env:
          JAVA_HOME: ${{ steps.setup-java.outputs.java-home }}
          
      - name: Upload APK
        uses: actions/upload-artifact@v2
        with:
          name: android
          path: build/android/**/*.apk
      - name: Install Butler
        run: |
            curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
            unzip butler.zip
            chmod +x butler
            sudo mv butler /usr/local/bin
      - name: Login to Butler
        run: butler login
        env:
          BUTLER_API_KEY: ${{ secrets.BUTLER }}
      - name: Push HTML5 build to Itch.io
        run: butler push build/html5 ${{secrets.ITCH_URL}}:html5
        env:
          BUTLER_API_KEY: ${{ secrets.BUTLER }}

Could you try to make a minimal example of this error happening and share that project?

I don’t think the github action has anything to do with this.

The error is talking about OnWindowFocus in platform_window_glfw.cpp which I’ve never seen before as being an issue on HTML5 but may be a recent regression

1 Like

Hi, the whole project is open source.

Let me know if this is too much and I’ll try creating an empty project just to see if it builds properly.

Here’s a link to the web build ( it’s unlisted now during development, but it’s still accessible via the link)

Fixed, it looks like you have to run distclean between builds, I changed the line where I build for web to this.
Thanks 1
java -jar $BOB --platform wasm-web --variant debug --bundle-output ./build/html5 --archive resolve distclean build bundle

1 Like