#Outlet issue on routes

5 messages · Page 1 of 1 (latest)

true willow
#

Hey everyone, I'm struggling at the moment with setting up my routes...

I have the following in app.tsx:

  return (
    <>
      <Router
        root={(props) => (
          <>
            <ColorModeScript storageType={storageManager.type} />
            <ColorModeProvider storageManager={storageManager}>
              <AuthProvider>
                <AuthGuard>{props.children}</AuthGuard>
              </AuthProvider>
            </ColorModeProvider>
          </>
        )}
      >
        <Route path="/" component={AuthLayout}>
          <Route path={["/", "/flags"]} component={Flags} />
          <Route path="/flags/:id" component={FlagIndex} />
          <Route path="/settings" component={Settings} />
        </Route>
        <Route path="/auth" component={DefaultLayout}>
          <Route path="/signin" component={SignIn} />
          <Route path="/signup" component={Signup} />
        </Route>
      </Router>
    </>
  )
}

I'm not sure if I'm setting up the routes here correctly, but I keep getting an error when it comes to no exported outlet.

In my /flags/[:id] route i have a useParam() and this is whats throwing the error. Is there a reason why I keep getting this error. Nothing renders.

Uncaught SyntaxError: The requested module '/_build/@fs/C:/Users/anonymous/Projects/anonmymous/node_modules/.pnpm/@[email protected][email protected]/node_modules/@solidjs/router/dist/index.jsx' does not provide an export named 'Outlet' (at router.tsx:2:22)```
tired junco
#

Can you provide a stackblitz which recreates the issue

odd raptor
#

the replacement for that is just a mere props.children like you would normally write a Wrapper Component