【问题标题】:Getting 404 Not Found, when hitting localhost flutter web url inside the chrome在 chrome 中点击 localhost flutter web url 时出现 404 Not Found
【发布时间】:2020-09-25 15:27:54
【问题描述】:

我使用命令运行了一个颤振项目 flutter run -d web-server --web-port=5000

这是相同的输出日志,我觉得不错:

Launching lib/main.dart on Web Server in debug mode... Syncing files to device Web Server...                                    22,524ms (!)                                        lib/main.dart is being served at http://localhost:5000

Warning: Flutter's support for web development is not stable yet and hasn't been thoroughly tested in production environments. For more information see https://flutter.dev/web

????  To hot restart changes while running, press "r". To hot restart (and refresh the browser), press "R". For a more detailed help message, press "h". To quit, press "q".

但是当我在浏览器中打开 url http://localhost:5000 时,它会抛出错误 404 not found。

【问题讨论】:

  • 试试http://localhost:5000/#/

标签: flutter flutter-web


【解决方案1】:

运行以下命令后问题已解决 flutter config --enable-web。 我从这个link找到了上面的解决方案

当我创建项目时,web 模块已经存在并且我假设 web config 已经启用。因此,我没有运行上述命令。在做了一些研究并做了一些试验和错误之后,我运行了上面的命令并且它工作了。

【讨论】:

    猜你喜欢
    • 2016-12-23
    • 1970-01-01
    • 2017-06-21
    • 1970-01-01
    • 2017-09-03
    • 2015-08-11
    • 1970-01-01
    • 2017-11-25
    • 2016-10-05
    相关资源
    最近更新 更多