Misery
Misery
SSolidJS
Created by Misery on 11/28/2024 in #support
Where to put <MetaProvider>
I want to use <Title> but i need to add this somewhere:
<MetaProvider>
<Title>Website Title</Title>
/MetaProvider>
<MetaProvider>
<Title>Website Title</Title>
/MetaProvider>
where do i put MetaProvider? I tried in my app.tsx file but it does not work
2 replies
SSolidJS
Created by Misery on 10/12/2024 in #support
.node file not being imported properly?
I don't know if I'm using the tags correctly, but I'm pretty sure this is an advanced question Trying to make a napi library to generate .node files from rust, and when trying to use the sample function napi provides my component isnt rendered:
import { Title } from "@solidjs/meta";
import { sum } from "~/backend";

export default function Test() {
return (
<main>
<Title>This should be visible if the component is rendered</Title>
<p>Test {getVersionDummy()}</p>
</main>
);
}

function getVersionDummy(): string {
console.log("this runs");
return sum(1, 3).toString();
}
import { Title } from "@solidjs/meta";
import { sum } from "~/backend";

export default function Test() {
return (
<main>
<Title>This should be visible if the component is rendered</Title>
<p>Test {getVersionDummy()}</p>
</main>
);
}

function getVersionDummy(): string {
console.log("this runs");
return sum(1, 3).toString();
}
8:41:30 PM [vite] Error when evaluating SSR module /mnt/c/Users/InhumaneTarball/Documents/Code/Rust/mcs-mngr/dms-web/src/routes/about.tsx?pick=default&pick=$css:
|- ReferenceError: require is not defined
at eval (/mnt/c/Users/InhumaneTarball/Documents/Code/Rust/mcs-mngr/dms-web/src/backend/index.js:12:5)
at instantiateModule (file:///mnt/c/Users/InhumaneTarball/Documents/Code/Rust/mcs-mngr/dms-web/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52870:11)
8:41:30 PM [vite] Error when evaluating SSR module /mnt/c/Users/InhumaneTarball/Documents/Code/Rust/mcs-mngr/dms-web/src/routes/about.tsx?pick=default&pick=$css:
|- ReferenceError: require is not defined
at eval (/mnt/c/Users/InhumaneTarball/Documents/Code/Rust/mcs-mngr/dms-web/src/backend/index.js:12:5)
at instantiateModule (file:///mnt/c/Users/InhumaneTarball/Documents/Code/Rust/mcs-mngr/dms-web/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52870:11)
I tried externalizing the backend code (where i output my napi build) to no avail
1 replies
SSolidJS
Created by Misery on 9/22/2024 in #support
`onMount` not called / Component not rendered?
I seriously do not know why this doesnt work:
export default function About() {
const [version, setVersion] = createSignal("Loading...");

onMount(() => {
console.log("onMount triggered");

const version = getVersion();
setVersion(version);
});

return (
<main>
<Title>About MCS</Title>
<p>Running {version()}</p>
</main>
);
}

function getVersion() {
return "dummy";
}
export default function About() {
const [version, setVersion] = createSignal("Loading...");

onMount(() => {
console.log("onMount triggered");

const version = getVersion();
setVersion(version);
});

return (
<main>
<Title>About MCS</Title>
<p>Running {version()}</p>
</main>
);
}

function getVersion() {
return "dummy";
}
as seen in the onMount line, im expecting a onMount Triggered message on my browser devtools but i seemingly get nothing. which leads me to the conclusion that my component isnt being rendered. this is backed up by the fact that the title hasnt changed any reasons as to how this happens? Im at my wit's end trying to understand why to no avail
6 replies
SSolidJS
Created by Misery on 9/21/2024 in #support
Foreign data not rendering unless page is reloaded
No description
1 replies
SSolidJS
Created by Misery on 9/14/2024 in #support
Cannot find module
No description
2 replies
SSolidJS
Created by Misery on 8/27/2024 in #support
Seemingly random hydration mismatches
Hello! I'm super new to solid js and web frameworks in general This is the code I use to check if a given server is online
<p class="col-start-2 row-start-1 text-right mr-3">Status: {
props.online ?
(
<div class="inline-flex gap-1">
<span class="text-server-online">●</span>
<span>Online</span>
</div>
) :
(
<div class="inline-flex gap-1">
<span class="text-server-offline">●</span>
<span>Offline</span>
</div>
)
}</p>
<p class="col-start-2 row-start-1 text-right mr-3">Status: {
props.online ?
(
<div class="inline-flex gap-1">
<span class="text-server-online">●</span>
<span>Online</span>
</div>
) :
(
<div class="inline-flex gap-1">
<span class="text-server-offline">●</span>
<span>Offline</span>
</div>
)
}</p>
And when I reload it, and only when I reload my webpage does it return a hydration mismatch. I only found out after making a commit. This is the code that fixed it:
{
props.online ?
(
<p class="col-start-2 row-start-1">Status:
<span class="text-server-online mx-1">●</span>
<span>Online</span>
</p>
) :
(
<p class="col-start-2 row-start-1">Status:
<span class="text-server-offline mx-1">●</span>
<span>Offline</span>
</p>
)
}
{
props.online ?
(
<p class="col-start-2 row-start-1">Status:
<span class="text-server-online mx-1">●</span>
<span>Online</span>
</p>
) :
(
<p class="col-start-2 row-start-1">Status:
<span class="text-server-offline mx-1">●</span>
<span>Offline</span>
</p>
)
}
Then I tried copying the div from the old code into the p, to simulate that the that server is online. I have a few questions: - Why error on reload and not when it hot reloads/reloads by itself? - Why arent divs allowed inside ps? Again I only know enough html to make a couple side projects. I've never actually done anything like this before
6 replies
SSolidJS
Created by Misery on 8/26/2024 in #support
`ReferenceError: jQuery is not defined`
No description
8 replies