Mat*_*att 1 javascript reactjs webpack react-router
我使用 webpack (1.12.2)、react (0.14.2)、react-router (1.0.0-rc4) 和History (1.13.0) 库。
当我使用 webpack 构建项目时,在 google chrome 控制台中出现错误:
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'.
Run Code Online (Sandbox Code Playgroud)
在createBrowserHistory.js第 41 行。
在我的源代码(index.jsx)中,我使用 createBrowserHistory:
var createBrowserHistory = require('history/lib/createBrowserHistory');
let history = createBrowserHistory();
ReactDOM.render(<Router routes={routes} history={history} />, document.getElementById('content'));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6822 次 |
| 最近记录: |