website icon indicating copy to clipboard operation
website copied to clipboard

Add remedy to 'Web enable for existing app' error on 'Building a web application with Flutter' page

Open mkhan-akhan opened this issue 1 year ago • 0 comments

Page URL

https://docs.flutter.dev/platform-integration/web/building/

Page source

https://github.com/flutter/website/tree/main/src/platform-integration/web/building.md

Describe the problem

In the last section 'Add web support to an existing app' there is no guidance on what to do if after the stated command the response is 'The web is currently not supported on your local environment.'

Expected fix

After the stated command add the following: If you get the message 'The web is currently not supported on your local environment.' then run the following command: $ flutter config --enable-web Then run the above flutter create command again.

Additional context

I copied a project from one Ubuntu development computer to another. The editor in both computers is Visual Studio Code. Flutter version is:

Flutter 3.13.2 • channel stable • https://github.com/flutter/flutter.git Framework • revision ff5b5b5fa6 (3 months ago) • 2023-08-24 08:12:28 -0500 Engine • revision b20183e040 Tools • Dart 3.1.0 • DevTools 2.25.0

Although the chrome device was in the device list in the original project, it was missing in the project copied to the new development computer. When I ran the 'flutter create --platforms web . command I received the following response:

You can find general documentation for Flutter at: https://docs.flutter.dev/ Detailed API documentation is available at: https://api.flutter.dev/ If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

$ cd . $ flutter run

Your application code is in ./lib/main.dart.

The web is currently not supported on your local environment. For more details, see: https://flutter.dev/docs/get-started/web

I ran the command: flutter config --enable-web and then ran the flutter create command again to fix the problem.

I believe it would save time for those not familiar with flutter config.

I would like to fix this problem.

  • [ ] I will try and fix this problem on docs.flutter.dev.

mkhan-akhan avatar Nov 13 '23 18:11 mkhan-akhan