Advertisement
Guest User

Untitled

a guest
Sep 8th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. Uncaught (in promise) Error: XHR error loading http://localhost:3000/jspm_packages/npm/redux-devtools@2.1.0/lib/react/themes/pop.js
  2. Error loading http://localhost:3000/jspm_packages/npm/redux-devtools@2.1.0/lib/react/themes/pop.js as "./pop" from http://localhost:3000/jspm_packages/npm/redux-devtools@2.1.0/lib/react/themes/index.js
  3. at r (http://localhost:3000/jspm_packages/system.js:4:10975)
  4. at XMLHttpRequest.o.onreadystatechange (http://localhost:3000/jspm_packages/system.js:4:11500)
  5.  
  6. Uncaught (in promise) Error: Cannot read property 'hasOwnProperty' of undefined
  7. Error loading http://localhost:3000/index.js
  8. at Object.checkAndWarnForMutatedProps (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactElementValidator.js:157:27)
  9. at Object.ReactReconciler.mountComponent (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactReconciler.js:13:31)
  10. at ReactCompositeComponentMixin.mountComponent (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactCompositeComponent.js:99:36)
  11. at ReactPerf.measure.wrapper [as mountComponent] (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactPerf.js:27:23)
  12. at Object.ReactReconciler.mountComponent (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactReconciler.js:11:37)
  13. at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactMultiChild.js:75:46)
  14. at ReactDOMComponent.Mixin._createContentMarkup (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactDOMComponent.js:146:34)
  15. at ReactDOMComponent.Mixin.mountComponent (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactDOMComponent.js:95:76)
  16. at Object.ReactReconciler.mountComponent (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactReconciler.js:11:37)
  17. at ReactCompositeComponentMixin.mountComponent (http://localhost:3000/jspm_packages/npm/react@0.13.3/lib/ReactCompositeComponent.js:99:36)
  18.  
  19. import React, { PropTypes, Component } from 'react'
  20. import { Redirect, Router, Route } from 'react-router'
  21. import { Provider } from 'react-redux'
  22. import { createStore, combineReducers, compose, applyMiddleware } from 'redux'
  23. import thunk from 'redux-thunk'
  24. import logger from './middleware/logger'
  25. import persistenceStore from './persistence/store'
  26. import { devTools } from 'redux-devtools'
  27. import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react.js'
  28. import App from './containers/App'
  29. import * as storage from './persistence/storage'
  30. import * as components from './components/index'
  31. import * as reducers from './reducers/index'
  32. import * as constants from './constants'
  33.  
  34. const __DEVTOOLS__ = true
  35.  
  36. const {
  37. AccountsList,
  38. Dashboard,
  39. SideBar,
  40. TitleBar,
  41. Login
  42. } = components
  43.  
  44. const initialState = {
  45. application: {
  46. token: storage.get('token'),
  47. user: { permissions: [] }
  48. }
  49. }
  50.  
  51. let combinedCreateStore
  52. const storeEnhancers = [persistenceStore]
  53.  
  54. if (__DEVTOOLS__) {
  55. storeEnhancers.push(devTools())
  56. }
  57.  
  58. combinedCreateStore = compose(...storeEnhancers)(createStore)
  59. const finalCreateStore = applyMiddleware(thunk, logger)(combinedCreateStore)
  60. const combinedReducer = combineReducers(reducers)
  61. const store = finalCreateStore(combinedReducer, initialState)
  62.  
  63. function getRootChildren (history) {
  64. const rootChildren = [
  65. <Provider key='provider' store={store}>
  66. {renderRoutes.bind(null, history)}
  67. </Provider>
  68. ]
  69.  
  70. if (__DEVTOOLS__) {
  71. rootChildren.push((
  72. <DebugPanel key='debug-panel' top right bottom>
  73. <DevTools store={store} monitor={LogMonitor}/>
  74. </DebugPanel>
  75. ))
  76. }
  77. return rootChildren
  78. }
  79.  
  80. export default class Root extends Component {
  81.  
  82. static propTypes = {
  83. history: PropTypes.object.isRequired
  84. }
  85.  
  86. render () {
  87. const { history } = this.props
  88. return (
  89. <div>{getRootChildren(history)}</div>
  90. )
  91. }
  92. }
  93.  
  94. function renderRoutes (history) {
  95. return (
  96. <Router history={history}>
  97. <Route component={App}>
  98. <Route path='/' component={Dashboard} />
  99. <Route path='accounts' component={AccountsList} />
  100. <Route path='login' component={Login} />
  101. <Route path='logout' onEnter={logout} />
  102. </Route>
  103. </Router>
  104. )
  105. }
  106.  
  107. function requireAuth (nextState, redirectTo) {
  108. const state = store.getState()
  109. const isLoggedIn = Boolean(state.application.token)
  110. if (!isLoggedIn) {
  111. redirectTo('/login', {
  112. nextPathname: nextState.location.pathname
  113. })
  114. }
  115. }
  116.  
  117. function logout (nextState, redirectTo) {
  118. store.dispatch({ type: constants.LOG_OUT })
  119. redirectTo('/login')
  120. }
  121.  
  122. {
  123. "version": "0.0.1",
  124. "description": "",
  125. "main": "index.js",
  126. "scripts": {
  127. "test": "standard"
  128. },
  129. "author": "",
  130. "jspm": {
  131. "directories": {
  132. "baseURL": "app"
  133. },
  134. "dependencies": {
  135. "classnames": "npm:classnames@^2.1.3",
  136. "history": "npm:history@^1.8.4",
  137. "react": "npm:react@^0.13.3",
  138. "react-pure-render": "npm:react-pure-render@^1.0.2",
  139. "react-redux": "npm:react-redux@^2.1.1",
  140. "react-router": "npm:react-router@1.0.0-beta4",
  141. "redux": "npm:redux@^2.0.0",
  142. "redux-devtools": "npm:redux-devtools@^2.1.0",
  143. "redux-thunk": "npm:redux-thunk@^0.1.0"
  144. },
  145. "devDependencies": {
  146. "babel": "npm:babel-core@^5.8.22",
  147. "babel-runtime": "npm:babel-runtime@^5.8.20",
  148. "core-js": "npm:core-js@^1.1.0"
  149. }
  150. },
  151. "devDependencies": {
  152. "browser-sync": "^2.9.1",
  153. "foundation-apps": "^1.1.0",
  154. "gulp": "^3.9.0",
  155. "gulp-sass": "^2.0.4",
  156. "redux": "^2.0.0",
  157. "redux-devtools": "^2.0.0",
  158. "rimraf": "^2.4.3",
  159. "standard": "^5.2.1",
  160. "vinyl": "^0.5.3"
  161. }
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement