Error when trying the tutorial: sheet-router: tree must be an array
See original GitHub issueExpected behavior
App expected to run in the browser. Other files run without problems.
Actual behavior
When trying to run with index.js
as described in
https://yoshuawuyts.gitbooks.io/choo/content/02_your_first_app.html
getting the error in browser console:
assert.js:59 Uncaught AssertionError: sheet-router: tree must be an array
Steps to reproduce behavior
Following the exact instructions in https://yoshuawuyts.gitbooks.io/choo/content/02_your_first_app.html
Reduced to the simplest form:
const choo = require('choo')
const html = require('choo/html')
const app = choo()
app.model({
state: {}
})
const view = (state, prev, send) => {
return html``
}
app.router((route) => [
route('/', view)
])
const tree = app.start()
document.body.appendChild(tree)
Still getting the error in the console
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Fix: ValueError: setting an array element with a ...
In this article, we will discuss how to fix ValueError: setting array element with a sequence using Python. Error which we basically ...
Read more >Error: The argument should be an array of numbers of length 3
I have encountered an error of 'the argument should be an array of numbers of length 3' when I am trying to pilot...
Read more >R Error in rowSums & colSums - must be array of at least two ...
In this tutorial, I'll show how to handle the “error in rowSums & colSums – 'x' must be an array of at least...
Read more >Compiler Error CS0838 - Microsoft Learn
Multidimensional arrays in expression trees cannot be initialized by using an array initializer. To correct this error. Create and initialize ...
Read more >Error while trying to predict numbers: Expected 2D array, got ...
ValueError: Expected 2D array, got 1D array instead. I know it's almost impossible to predict in this case, but my main goal here...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to fix the problem by changing the router declaration to
Perhaps the router expects an array rather than function?
Fixed thx!