4

I've deployed flutter project on vercel from github, but after deployment it shows:

404: NOT_FOUND Code: NOT_FOUND.
Framework presets: Others

Build log:

15:28:18.542 Cloning github.com/Usman167/UPKeepApp-FluxStore- (Branch: master, Commit: e331f69) 15:28:20.977 Cloning completed: 2.435s
15:28:21.169 Analyzing source code...
15:28:26.899 Uploading build outputs...
15:28:26.913 Deploying build outputs...
15:28:33.974 Done with "."

enter image description here

2 Answers 2

8

You can change your Vercel project settings to build and deploy a Flutter Web project.

Build & Development Settings

  • Framework Preset: Other
  • Build Command: flutter/bin/flutter build web --release
  • Output Directory: build/web
  • Install Command: if cd flutter; then git pull && cd .. ; else git clone https://github.com/flutter/flutter.git; fi && ls && flutter/bin/flutter doctor && flutter/bin/flutter clean && flutter/bin/flutter config --enable-web

Screenshot of Vercel Build Settings for Flutter

Example build log showing a successful Flutter deploy

Screenshot of Vercel Build Log for Flutter

4
  • Do you know how I can checkout a specific version of flutter? Because wtih some versions the build is failing due to null safety not working(enforced??) e.G. if I want to use flutter version 2.2.3
    – Pumuckelo
    Oct 8, 2021 at 14:08
  • 1
    Solution: you can just use "git checkout 2.2.3" to use a specific version. Example of my bash script: #!/bin/bash if cd flutter; then git pull && cd .. ; else git clone https://github.com/flutter/flutter.git -b stable; fi && ls && cd flutter && git checkout 2.2.3 && cd .. && flutter/bin/flutter doctor && flutter/bin/flutter clean && flutter/bin/flutter pub get
    – Pumuckelo
    Oct 8, 2021 at 14:24
  • I'm getting the error Error: The 'super-parameters' language feature is disabled for this library.. Any idea?
    – Jonas
    Oct 12, 2022 at 15:07
  • I fixed my issue by updating the flutter version, updating all packages and setting the SDK to ">=2.17.0 <3.0.0"
    – Jonas
    Oct 12, 2022 at 19:13
0

Method 1

run the command in the root of project:flutter build web build the flutter web  by run the command in the root of the project:flutter build web

create new repository in github and upload the web folder to github enter image description here

and follow the procedure in below figure in vercel enter image description here

https://githubactionss.vercel.app/#/ https://github.com/lavahasif/githubaction

Method 2

Just Create Flutter template project(test)

flutter create -t skeleton my_app

enter image description here verify the web folder (enable web) exist other wise vercel show error enter image description here upload the entire project to github do like this enter image description here

  • Build Command: flutter/bin/flutter build web --release
  • Output Directory: build/web
  • Install Command: if cd flutter; then git pull && cd .. ; else git clone https://github.com/flutter/flutter.git; fi && ls && flutter/bin/flutter doctor && flutter/bin/flutter clean && flutter/bin/flutter config --enable-web

and Finally just deploy the link like this https://web-my-app.vercel.app/#/

5
  • Bro can You guide me about flutter Mobile app project.
    – Usman Sahi
    Jun 21, 2021 at 10:50
  • I think you want to host your flutter project as website in vercel.isn't it?.
    – lava
    Jun 21, 2021 at 13:01
  • bro actually i'm using stripe payment gateway in my flutter mobile app. For that i've deployed it on vercel. but it shows this error.
    – Usman Sahi
    Jun 22, 2021 at 8:42
  • fidev.io/stripe-checkout-in-flutter-web. did you tried this
    – lava
    Jun 24, 2021 at 6:45
  • itnext.io/…
    – lava
    Jun 24, 2021 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.