I am trying to deploy a Flutter web app to Firebase hosting using the FirebaseExtended/action-hosting-deploy action and the experimental webframeworks
flag. Here is my GitHub workflow file:
<code>name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.19.0
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLUTTER_FAST }}
channelId: live
projectId: flutter-fast
target: flutter-ast-viewer
env:
FIREBASE_CLI_EXPERIMENTS: webframeworks
</code>
<code>name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.19.0
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLUTTER_FAST }}
channelId: live
projectId: flutter-fast
target: flutter-ast-viewer
env:
FIREBASE_CLI_EXPERIMENTS: webframeworks
</code>
name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.19.0
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLUTTER_FAST }}
channelId: live
projectId: flutter-fast
target: flutter-ast-viewer
env:
FIREBASE_CLI_EXPERIMENTS: webframeworks
Whenever this workflow runs, the web page gets updated but it’s blank and the following error appears on the network tab:
GET https://flutter-ast-viewer.web.app/flutter_bootstrap.js net::ERR_ABORTED 404 (Not Found)
If I deploy the app using the command line (firebase deploy
), everything works fine.
Firebase.json
<code>{
"hosting": {
"site": "flutter-ast-viewer",
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "us-east1"
}
}
}
</code>
<code>{
"hosting": {
"site": "flutter-ast-viewer",
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "us-east1"
}
}
}
</code>
{
"hosting": {
"site": "flutter-ast-viewer",
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "us-east1"
}
}
}
.firebaserc
<code>{
"projects": {
"default": "flutter-ast-viewer"
}
}
</code>
<code>{
"projects": {
"default": "flutter-ast-viewer"
}
}
</code>
{
"projects": {
"default": "flutter-ast-viewer"
}
}