Skip to content

Cannot read properties of undefined (reading 'length') #272

Description

@mathieuprog

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions