2016-04-11 5 views
4

私は角度ベースのアプリケーションをfirebaseに配備しました。私は、ページの罰金で看板を見ることができますが、私はページをリロードしたとき、私は次のエラーを取得する:ここでFirebaseの角ページを再ロードするときにページが見つかりません

{ 
    "firebase": "******", 
    "public": "dist", 
    "ignore": [ 
    "firebase.json", 
    "**/.*", 
    "**/node_modules/**" 
    ] 
} 

:エラーは、私は私のfirebase.jsonファイルをチェックし、それがこの表示示唆

This file does not exist and there was no index.html found in the current directory or 404.html in the root directory. 

Why am I seeing this? 

You may have deployed the wrong directory for your application. Check your firebase.json and make sure the public directory is pointing to a directory that contains an index.html file. 
You can also add a 404.html in the root of your site to replace this page with a custom error page. 

ように私のpublicフォルダが私のdistフォルダであることがわかります。このdistフォルダーは実際にどこに私のファイル(css、js、html、index.html)を置くところです。フォルダ構造は次のようになります。

dist 
    css 
    images 
    js 
    templates 
    index.html 

ので、保存先のフォルダは、上記のindex.htmlページを持っている - なぜ私はこのエラーを取得していますか?角度はここでステップしてすべてのルーティングを処理する必要がありますが、そうではないようです。

EDIT

enter image description here

+0

ここでは、問題の解決方法を示唆するものはありません。他の何かが遊ぶべきである。あなたの展開で--debugを試して、アップロードされているファイルとスキップされているファイルを正確に確認できますか? – Kato

+0

@Kato私はこの先週尋ねたことは知っていますが、ここで何が起こっているか他の考えがありますか? – Katana24

答えて

11

は、私は問題を修正 - この問題はFirebaseによって引き起こされる(実際にすべてのサーバーが、私は思う)各角度状態は、独自のindex.htmlファイルが含まれている必要がありフォルダであることを信じて - 明らかにこれは当てはまりません。

フォルダのルートにあるindex.htmlのみを参照する必要があります。次のおfirebase.jsonファイルを変更する必要があることを行うには:

{ 
    "firebase": "app-name", 
    "public": "dist", 
    "ignore": [ 
    "firebase.json", 
    "**/.*", 
    "**/node_modules/**" 
    ], 
    "rewrites": [{ 
    "source": "/public/**", 
    "destination": "/public.html" 
    }, 
    { 
    "source": "**", 
    "destination": "/index.html" 
    }] 
} 

をここで重要な部分は、書き換えやソースオブジェクトです。これに関する詳細については、の説明ページを参照してください。firebase.json

関連する問題