-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'split' of null #66
Comments
Are you able to provide some kind of test case? I've never encountered this before |
Sure! this is my main function. import xs from 'xstream'
import {run} from '@cycle/xstream-run'
import {makeDOMDriver} from '@cycle/dom'
import {makeRouterDriver} from 'cyclic-router'
import {createHistory} from 'history'
import {html} from 'snabbdom-jsx'
function main(sources) {
const {DOM, router} = sources
const routedSink$ = router.define({
'/1': sources => ({
DOM: xs.of(
<div>Home</div>
)
}),
'/2': sources => ({
DOM: xs.of(
<div>About</div>
)
})
}).map(({path, value: Component}) => Component({
...sources,
router: router.path(path)
}))
const dom$ = routedSink$.map(s => s.DOM).flatten()
return {
DOM: dom$,
router: xs.of('/1')
}
}
const drivers = {
DOM: makeDOMDriver('#app'),
router: makeRouterDriver(createHistory())
};
run(main, drivers); |
package.json here : {
...
"dependencies": {
"@cycle/dom": "^10.0.4",
"@cycle/isolate": "^1.4.0",
"@cycle/xstream-run": "^3.0.3",
"babel-core": "^6.10.4",
"babel-loader": "^6.2.4",
"babel-plugin-transform-es2015-modules-commonjs": "^6.10.3",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-plugin-transform-react-jsx": "^6.8.0",
"css-loader": "^0.23.1",
"cyclic-router": "^2.1.2",
"debug": "^2.2.0",
"history": "^3.0.0",
"install": "^0.8.1",
"node-sass": "^3.8.0",
"npm": "^3.10.3",
"sass-loader": "^4.0.0",
"snabbdom-jsx": "^0.3.0",
"style-loader": "^0.13.1",
"webpack": "^1.13.1",
"xstream": "^5.0.6"
},
"devDependencies": {
"babel-register": "^6.9.0",
"eslint": "^3.0.0",
"ignore-styles": "^4.0.0",
"nodemon": "^1.9.2",
"tap-notify": "^1.0.0",
"tape": "^4.6.0",
"webpack-dev-server": "^1.14.1"
}
} |
Great, thank you. I'll dig into the issue this week |
Any news on this issue? |
Same with this issues. Here's my code:
And my main function is like this:
Also another question: How can I use hashHistory in my router?
And it also cause warning:
Many thanks! |
|
It seems that if there is no root route
'/'
in route definition, then above error occurs.The text was updated successfully, but these errors were encountered: