Mamink
Mamink

Reputation: 327

flutter build web doesn't create flutter.js

I recently made a flutter application and now I want to get a web release, but when I run flutter build web and upload stored files in {root}/build/web on the host, everything is showing on chrome and firefox with that URL is an empty page with 2 console errors: _flutter is not defined GET https://web.pushers.ir/flutter.js 404 I took a look at my released files and didn't see any file named flutter.js, I tried flutter build web many times but nothing, also I tried to create another flutter project as a sample and ran flutter web build, on that sample everything was ok and flutter.js created with other released files What should I do?

Upvotes: 9

Views: 4160

Answers (2)

Kalex
Kalex

Reputation: 356

Had the same issue.

Long story short: run flutter clean instead of manually deleting the /build/web folder or its content. The next build that follows will properly generate all files, including flutter.js.

More info why that is happening

Upvotes: 11

Mamink
Mamink

Reputation: 327

I just copied flutter.js from a sample project release into my app release and it works

Upvotes: 0

Related Questions