S
SolidJS2mo ago
Misery

.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
NAPI-RS
Home – NAPI-RS
NAPI-RS is a framework for building Node.js addons in Rust.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server