0
我使用webpack(1.12.2),react(0.14.2),react-router(1.0.0-rc4)和history(1.13.0)庫。未捕獲SecurityError:無法執行'歷史記錄'上的'replaceState':具有URL的歷史狀態對象
當我與建設項目的WebPack,谷歌瀏覽器的控制檯,我得到錯誤:
Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///Users/and/devel/Wond/index.html' cannot be created in a document with origin 'null'.
在我的源代碼(index.jsx)我用createBrowserHistory:
var createBrowserHistory = require('history/lib/createBrowserHistory');
let history = createBrowserHistory();
ReactDOM.render(<Router routes={routes} history={history} />, document.getElementById('content'));
https://stackoverflow.com/questions/32398578/history-replacestate-no-longer-working-in-chrome-for-local-file – Andreas
然後我得到錯誤:'警告:位置「/用戶/和/ devel/Wond_dist/index.html「與任何路線不匹配」 – Matt