subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.17k stars 193 forks source link

Broken web build generated by the github action #156

Closed janosgy closed 2 years ago

janosgy commented 2 years ago

Hi, When I run flutter build web --release on my Mac, (

Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5464c5bac7 (2 weeks ago) • 2022-04-18 09:55:37 -0700
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2

) And I manually copy the generated files to our cloud service, everything is working as expected.

But when a GitHub action generates the build, the application shows up as a white screen with this error in the console:

Uncaught Instance of 'minified:K4'
    at Object.c (https://domain.web.core.windows.net/main.dart.js:3948:3)
    at https://domain.web.core.windows.net/main.dart.js:71223:24
    at apa.a (https://domain.web.core.windows.net/main.dart.js:5137:62)
    at apa.$2 (https://domain.web.core.windows.net/main.dart.js:34715:14)
    at aob.$1 (https://domain.web.core.windows.net/main.dart.js:34709:21)
    at Ec.n_ (https://domain.web.core.windows.net/main.dart.js:35771:31)
    at ajW.$0 (https://domain.web.core.windows.net/main.dart.js:35069:11)
    at Object.uS (https://domain.web.core.windows.net/main.dart.js:5233:40)
    at a7.nv (https://domain.web.core.windows.net/main.dart.js:34992:3)
    at RO.cl (https://domain.web.core.windows.net/main.dart.js:34704:8)

I tried to narrow the scope down by uploading the build as an artifact and I manually copied it over to the server, got the same result (ubuntu-latest)

    - uses: actions/checkout@v3
    - uses: subosito/flutter-action@v2
      with:
        channel: 'stable'

    - name: Install dependencies
      run: flutter pub get

    - name: Build Web
      run: flutter build web --release

    - name: Upload Artifact
      uses: actions/upload-artifact@v3
      with:
        name: web-build
        path: build/web
        retention-days: 1

do you have any ideas?

janosgy commented 2 years ago

False alarm, sorry. I simplified the example too much. I also use SpicyPizza/create-envfile@v1.3 in my action, and the problem was that the .env file was not filled with my configs.