SolidJSS
SolidJSโ€ข12mo ago
be_cool

@solid-mediakit/auth

I am trying to use @solid-mediakit/auth . But I keep running into this error when trying to create a protected route.

5:35:31 PM [vite] Error when evaluating SSR modulesrc/routes/protected/index.tsx?pick=default&pick=$css:
|- TypeError: __vite_ssr_import_10__.query is not a function


here is my app config

import { authVite } from '@solid-mediakit/auth-plugin'
import { defineConfig } from '@solidjs/start/config'

export default defineConfig({
  ssr: true,
  vite: {
    plugins: [
      authVite({
        authOpts: {
          name: 'authOptions',
          dir: '~/server/auth',
        },
        redirectTo: '/login',
      }),
    ],
  },
})

And here is the protected route

import { protected$ } from '@solid-mediakit/auth'

export default protected$((session$) => {
  return (
    <main>
      <h1>Protected Route</h1>
    </main>
  )
}, '/login')
Was this page helpful?