【问题标题】:Host an Ionic app into AWS S3 Bucket - Not working/rendering将 Ionic 应用程序托管到 AWS S3 存储桶中 - 不工作/渲染
【发布时间】:2017-10-25 17:00:49
【问题描述】:

我使用 ionic2 框架创建了一个简单的应用程序,并且在本地机器/在一个简单的“lite-server”后面运行良好

我想在 AWS S3 中部署相同的内容 - 使用“启用静态网络托管”并从移动浏览器尝试

我跑了 - ionic build browser

这在 \MyApp\platforms\browser\www 中创建了一个静态网页内容。

我使用了节点工具 's3-website' - https://www.npmjs.com/package/s3-website

将我的应用内容发布到 S3

一切顺利,我启用了静态网络托管,每个人都可以查看,但它没有呈现。

已编辑 应用程序模块名称“MyApp”和 s3 存储桶名称是否应该匹配?好奇?

在 Chrome 控制台中,我收到这些错误

Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
/build/main.css Failed to load resource: the server responded with a status of 404 (Not Found)
device.js Failed to load resource: the server responded with a status of 404 (Not Found)
statusbar.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
StatusBarProxy.js Failed to load resource: the server responded with a status of 404 (Not Found)
SplashScreenProxy.js Failed to load resource: the server responded with a status of 404 (Not Found)
splashscreen.js Failed to load resource: the server responded with a status of 404 (Not Found)
DeviceProxy.js Failed to load resource: the server responded with a status of 404 (Not Found)
keyboard.js Failed to load resource: the server responded with a status of 404 (Not Found)
cordova.js:1297 Uncaught Error: Module cordova-plugin-device.device does not exist.
    at addEntry (cordova.js:1297)
    at Object.exports.clobbers (cordova.js:1307)
    at onScriptLoadingComplete (cordova.js:1551)
    at HTMLScriptElement.scriptLoadedCallback (cordova.js:1584)
addEntry @ cordova.js:1297
exports.clobbers @ cordova.js:1307
onScriptLoadingComplete @ cordova.js:1551
scriptLoadedCallback @ cordova.js:1584
cordova.js:1582 [Violation] 'error' handler took 177ms
main.css Failed to load resource: the server responded with a status of 404 (Not Found)
cordova.js:1051 deviceready has not fired after 5 seconds.
cordova.js:1044 Channel not fired: onPluginsReady
cordova.js:1044 Channel not fired: onCordovaReady

【问题讨论】:

    标签: angular redirect ionic-framework amazon-s3 routing


    【解决方案1】:

    确保您的所有文件都复制到那里。如果可能,安装 AWS CLI 并清除存储桶中的现有文件。现在,尝试 aws s3 cp s3:/// --recursive。希望对你有帮助

    【讨论】:

      【解决方案2】:

      看起来文件丢失或文件夹结构不正确。您是否从本地计算机测试了该站点?创建一个文件夹并将整个网站内容下载/复制到本地文件夹。现在启动 index.html 看看会发生什么。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-02-01
        • 2020-07-24
        • 1970-01-01
        • 2016-02-03
        • 1970-01-01
        • 2021-05-27
        • 1970-01-01
        相关资源
        最近更新 更多