【问题标题】:After flutter build web shows nothing on build files not working shows blank在颤振构建网站后没有显示构建文件不工作显示空白
【发布时间】:2021-09-12 18:27:45
【问题描述】:

在颤振运行 -d chrome 运行罚款但在颤振构建 web 构建后我从 build/web/index.html 运行 build index.html 只显示空白屏幕并且在控制台中显示一些错误,请注意这是颤振计数器应用程序.

Consoles errors screenshot

【问题讨论】:

    标签: flutter build flutter-web


    【解决方案1】:

    您需要在某个应用服务器上运行它,请参阅下面的示例以使用ExpressJs 在节点服务器上运行它。

    const express = require('express')
    const app = express()
    const port = 3000
    
    // add web folder path created after flutter build
    app.use(express.static('your_web_folder_path'))
    
    app.listen(port, () => {
      console.log(`Example app listening at http://localhost:${port}`)
    })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-18
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-12
      相关资源
      最近更新 更多