ken_binta
ken_binta
Explore posts from servers
SSolidJS
Created by ken_binta on 1/20/2025 in #support
@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
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',
}),
],
},
})
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')
import { protected$ } from '@solid-mediakit/auth'

export default protected$((session$) => {
return (
<main>
<h1>Protected Route</h1>
</main>
)
}, '/login')
1 replies
SSolidJS
Created by ken_binta on 12/25/2024 in #support
useTransition not working
Hello , I am trying to utilize useTransition but Im not sure if I am doing anything wrong or haven't understood how it works.
import { createSignal, useTransition } from 'solid-js'

export default function Counter() {
const [count, setCount] = createSignal(1)
const [isPending, start] = useTransition()

const increment = () => {
start(() => {
setTimeout(() => {
setCount((p) => p + 1)
}, 2000)
})
}

return (
<>
<button type="button" onClick={increment}>
{count()}
</button>
<br />

{isPending() ? 'Yes' : 'No'}
</>
)
}
import { createSignal, useTransition } from 'solid-js'

export default function Counter() {
const [count, setCount] = createSignal(1)
const [isPending, start] = useTransition()

const increment = () => {
start(() => {
setTimeout(() => {
setCount((p) => p + 1)
}, 2000)
})
}

return (
<>
<button type="button" onClick={increment}>
{count()}
</button>
<br />

{isPending() ? 'Yes' : 'No'}
</>
)
}
2 replies
DTDrizzle Team
Created by ken_binta on 6/9/2024 in #help
Unknown Option
No description
1 replies
SSolidJS
Created by ken_binta on 5/24/2024 in #support
NOT_FOUND
Hello, just tried out SolidStart, I tried to deploy to vercel but I got the error "NOT FOUND". I did the same with netlify and got a similar error of page not found. I am using bun. Here is my package.json { "name": "example-with-tailwindcss", "type": "module", "scripts": { "dev": "vinxi dev", "build": "vinxi build", "start": "vinxi start" }, "dependencies": { "@kobalte/core": "^0.13.1", "@solidjs/router": "^0.13.3", "@solidjs/start": "^1.0.0", "@tanstack/solid-query": "^5.37.1", "autoprefixer": "^10.4.19", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "postcss": "^8.4.38", "solid-js": "^1.8.17", "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.3", "tailwindcss-animate": "^1.0.7", "vinxi": "^0.3.11" }, "engines": { "node": ">=18" } }
3 replies