Cannot read properties of undefined (reading 'length')
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start by reproducing the throwing path shown in the issue and inspect the router code involved in the components.jsx stack trace, especially the handling of route evaluation errors. Confirm that the original error message, “A meaningful error message,” is preserved instead of being replaced by the undefined-length TypeError.
Written by the indexing model from the issue text.
Description
Describe the bug
It took me forever to debug an error because the error message got lost by the router. Demonstration:
function throwError(): string {
throw new Error('A meaningful error message');
}
<Route
path={throwError()}
element={<div>hello</div>}
/>
This leads to the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at components.jsx:40:43
at dev.js:453:34
at untrack (dev.js:434:12)
at Object.fn (dev.js:453:20)
at runComputation (dev.js:696:22)
at updateComputation (dev.js:679:3)
at Object.readSignal (dev.js:612:67)
at get when [as when] (components.jsx:64:25)
at Show.createMemo.equals [as fn] (dev.js:1443:44)
at runComputation (dev.js:696:22)
The original error message ('A meaningful error message') got lost.
Platform
- OS: Windows
- Browser: Chrome 113
- Solid: 1.7.6
- Solid router: 0.8.2
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 180
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 19
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from solidjs/solid-router
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
solidjs/solid-router#613 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
solidjs/solid-router#605 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
solidjs/solid-router#603 · 1 comment ·
-
<A> costs ~6us of server CPU per instance during SSR (20x a plain <a>), mostly mergeProps/splitProps Open
Difficulty 4/5 3-5 days Newbie friendliness 55/100
solidjs/solid-router#583 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
solidjs/solid-router#569 · 3 comments ·
All issues in solidjs/solid-router
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·