Luka
How to make a map?
Basically I want to be able to display roads and terrain normally, I want 2 user to be able to share their current location which will update per some seconds, also I want to add icons on the map and I want o have only one country. will MapLibre be helpful in this case?
23 replies
[h3] [unhandled] H3Error: Client-only API called on the server side. Run client-only code in onMount
I did fix the error but I got different error now:
Error when evaluating SSR module /home/lukachikvaidze/projects/sheuketee/src/routes/(Landing).jsx?pick=default&pick=$css:
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
This I think should be either configs or the way I am fetching data I haven't been looking in docs for some time just saw that cache function has been deprecated and some other functions are keep coming.
createAsync that I had written was working perfectly around 2 days ago so here is what I got for now
"use server"
import { query } from "@solidjs/router";
import { verify_user } from "./session_management";
import { getRequestEvent } from "solid-js/web";
export const header = query(async () => {
try {
const event = getRequestEvent();
const session = await verify_user(event);
if (session === 401) {
throw new Error(401);
}
return {
profId: session.profId,
role: session.role,
};
} catch (error) {
if (error.message === "401") {
return 401;
}
console.log("GET USER", error);
}
}, "user-ident");
import { header } from "~/routes/api/header";
const user = createAsync(() => header());
I might not be using best practices here but I just want to know if fetching is correct23 replies
[h3] [unhandled] H3Error: Client-only API called on the server side. Run client-only code in onMount
So far What i did is I cloned current code from github and completely wiped most of the code just left a hello world page modified versions in it as well but it didn't work, also tried just creating solidstart template i did install everything but npm run dev and I still get the same error
there might be more recent approach to creating solidstart template so I will include what I did so I just ran
npm init solid@latest
then npm install
and then npm run dev
which as I said yield the same error.
So now I am thinking my PC has some package problems since I have debian I maybe messed something up.23 replies
[h3] [unhandled] H3Error: Client-only API called on the server side. Run client-only code in onMount
So the landing page the localhost:3000 that I have only Header.jsx makes request to the Header.js file which might have some problems but its not only the landing localhost:3000 page that throws the error all the routes that I have behave same, is there anything wrong with configs? It might be versions complicating with each other as well right?
23 replies
[h3] [unhandled] H3Error: Client-only API called on the server side. Run client-only code in onMount
I had something similar bug back then and it was really small import problem it took me so long to figure out back then I will check imports as well
23 replies
[h3] [unhandled] H3Error: Client-only API called on the server side. Run client-only code in onMount
@Erik Demaine Here is the code https://github.com/7Luke7/sheuketee/tree/main
23 replies
[h3] [unhandled] H3Error: Client-only API called on the server side. Run client-only code in onMount
Actually around a month ago the code was working fine I had some stuff going on so couldn't continue writing code for this project. Did I miss some crucial updates? idk, I would be glad if someone could clue me.
23 replies
Suspense and dealing with large data
When I am using deferStream true it doesnt show the suspense fallbacks but as soon as I set it to false the fallbacks work well. Is it because of deferStream that suspenses dont work in my case?
deferStream should be waiting for all the data until rendering the suspense so it kind of skips it I guess correct me if I am wrong.
But if this is the case how can I have loading with the deferStream: true? I want to keep deferstream because of SSR.
I might be completely wrong about how these work I am new to SSR and solid as well )
So here is how I fetch the data now I changed it to multiple request so I could use multiple suspenses I guess
const user = createAsync(async () => {
const [userData, userSkills] = await Promise.all([
get_xelosani(props.params.id),
get_skills(props.params.id)
]);
return { userData, userSkills };
}, { deferStream: true });
I kind of pass down data to another component like this
<ProfileRight
user={user}
setEditingServiceTarget={setEditingServiceTarget}
setModal={setModal}
/>
<Suspense
fallback={
<p>Loading...</p>
}
>
<p class="text-xs font-[thin-font] font-bold">
შემოუერთდა {props.user()?.userData?.creationDateDisplayable}
</p>
</Suspense>
<section class="w-full flex">
<Suspense fallback={<div>
Loading...
</div>}>
<SkillCarousel skills={props.user()?.userSkills?.skills}></SkillCarousel>
</Suspense>
</section>
5 replies