Saaa
How to get and set simple data or a variable in a session?
I tried settings the username and then reading it in a session in the client side in the following code but it gives an error:
import { useSession } from "vinxi/http";
function getSession() {
return useSession({
password: process.env.SESSION_SECRET
});
}
export default function Index() {
const session = getSession();
session.data.user = "adam"; //set the user name
const username : string = session.data.user //get the user name
return (
<div>
<p>Username: {username}</p>
</div>
);
}
4 replies
Cannot read properties of null (reading 'nextSibling') ERROR in a hello world simple Solidstart web
i just added a route called docs to a brand new project in routes folder docs.mdx and inside it a text message hello world and when i enter the route it gives me this error Cannot read properties of null (reading 'nextSibling')
../../../solid-js/web/dist/dev.js
createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));
return () => current;
}
if (hydrating) {
if (!array.length) return current;
if (marker === undefined) return [...parent.childNodes];
let node = array[0];
let nodes = [node];
while ((node = node.nextSibling) !== marker) nodes.push(node);
return (current = nodes);
}
if (array.length === 0) {
current = cleanChildren(parent, current, marker);
if (multi) return current;
} else if (currentArray) {
if (current.length === 0) {
appendNodes(parent, array, marker);
2 replies