Ciantic
Ciantic
Explore posts from servers
DDeno
Created by Ciantic on 10/27/2024 in #help
Vinxi build is trying to run node.exe instead of deno.exe?
Test repo https://github.com/Ciantic/deno-solid-test/ See the error:
$ deno run -A build # this does not work, it gives error like:

Task build vinxi build
vinxi v0.4.3

Building your app...
vinxi v0.4.3
(node:53524) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node.EXE --trace-warnings ...` to show where the warning was created)
ReferenceError: Deno is not defined
at file:///C:/Source/JavaScript/solid-start-test/deno-solid-test/node_modules/.deno/@[email protected]/node_modules/@jsr/std__fs/ensure_symlink.js:7:19
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
$ deno run -A build # this does not work, it gives error like:

Task build vinxi build
vinxi v0.4.3

Building your app...
vinxi v0.4.3
(node:53524) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node.EXE --trace-warnings ...` to show where the warning was created)
ReferenceError: Deno is not defined
at file:///C:/Source/JavaScript/solid-start-test/deno-solid-test/node_modules/.deno/@[email protected]/node_modules/@jsr/std__fs/ensure_symlink.js:7:19
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
Notice node.EXE warning
4 replies
DDeno
Created by Ciantic on 10/23/2024 in #help
Vinxi project such as solid-start doesn't work with Deno 2.0
Here is a repo: https://github.com/Ciantic/deno-solid-test This most likely because Vinxi runs node.exe behind the scenes instead of deno.exe. It's notable that bun also has same error, but it can be fixed by using a flag --bun that fakes bun.exe as node.exe. Maybe deno needs similar functionality as bun.
11.50.18 [vite] Error when evaluating SSR module C:/Source/JavaScript/solid-start-test/deno-solid-test/src/routes/index.tsx?pick=default&pick=$css: failed to import "jsr:@db/[email protected]"
|- Error: Cannot find module 'jsr:@db/[email protected]' imported from 'C:/Source/JavaScript/solid-start-test/deno-solid-test/src/db/db.ts'
at nodeImport (C:\Source\JavaScript\solid-start-test\deno-solid-test\node_modules\.deno\[email protected]\node_modules\vite\dist\node\chunks\dep-Cyk9bIUq.js:53036:19)
at ssrImport (C:\Source\JavaScript\solid-start-test\deno-solid-test\node_modules\.deno\[email protected]\node_modules\vite\dist\node\chunks\dep-Cyk9bIUq.js:52903:22)
at undefined
at async instantiateModule (C:\Source\JavaScript\solid-start-test\deno-solid-test\node_modules\.deno\[email protected]\node_modules\vite\dist\node\chunks\dep-Cyk9bIUq.js:52961:5)
11.50.18 [vite] Error when evaluating SSR module C:/Source/JavaScript/solid-start-test/deno-solid-test/src/routes/index.tsx?pick=default&pick=$css: failed to import "jsr:@db/[email protected]"
|- Error: Cannot find module 'jsr:@db/[email protected]' imported from 'C:/Source/JavaScript/solid-start-test/deno-solid-test/src/db/db.ts'
at nodeImport (C:\Source\JavaScript\solid-start-test\deno-solid-test\node_modules\.deno\[email protected]\node_modules\vite\dist\node\chunks\dep-Cyk9bIUq.js:53036:19)
at ssrImport (C:\Source\JavaScript\solid-start-test\deno-solid-test\node_modules\.deno\[email protected]\node_modules\vite\dist\node\chunks\dep-Cyk9bIUq.js:52903:22)
at undefined
at async instantiateModule (C:\Source\JavaScript\solid-start-test\deno-solid-test\node_modules\.deno\[email protected]\node_modules\vite\dist\node\chunks\dep-Cyk9bIUq.js:52961:5)
4 replies
SSolidJS
Created by Ciantic on 10/22/2024 in #support
H3Error: Cannot find module 'bun:sqlite' imported from
Same code works just fine with better-sqlite3 File has "use server" at start, so how it tries to find it seems to be important?
4 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
I noticed that if I don't have Suspense component in SolidStart, the whole page refreshes and createResource loading state doesn't render at all. For example if use this snippet from regular docs in solidstart project:
import { createSignal, createResource, Switch, Match, Show } from "solid-js";

const fetchUser = async (id) =>
{
const response = await fetch(`https://swapi.dev/api/people/${id}/`);
return response.json();
}

function App() {
const [userId, setUserId] = createSignal();
const [user] = createResource(userId, fetchUser);

return (
<div>
<input
type="number"
min="1"
placeholder="Enter Numeric Id"
onInput={(e) => setUserId(e.currentTarget.value)}
/>
<Show when={user.loading}>
<p>Loading...</p>
</Show>
<Switch>
<Match when={user.error}>
<span>Error: {user.error}</span>
</Match>
<Match when={user()}>
<div>{JSON.stringify(user())}</div>
</Match>
</Switch>

</div>
);
}
import { createSignal, createResource, Switch, Match, Show } from "solid-js";

const fetchUser = async (id) =>
{
const response = await fetch(`https://swapi.dev/api/people/${id}/`);
return response.json();
}

function App() {
const [userId, setUserId] = createSignal();
const [user] = createResource(userId, fetchUser);

return (
<div>
<input
type="number"
min="1"
placeholder="Enter Numeric Id"
onInput={(e) => setUserId(e.currentTarget.value)}
/>
<Show when={user.loading}>
<p>Loading...</p>
</Show>
<Switch>
<Match when={user.error}>
<span>Error: {user.error}</span>
</Match>
<Match when={user()}>
<div>{JSON.stringify(user())}</div>
</Match>
</Switch>

</div>
);
}
It will not show loading text at all, just the whole page refreshes when typing to input. This is quiet confusing when coming from normal SolidJS, that createResource loading etc are now useless. Thanks!
76 replies
DDeno
Created by Ciantic on 3/7/2023 in #help
Date-fns typings don't work?
I'm trying this code:
import { startOfDay } from "https://esm.sh/[email protected]";

// No error?
let foo = startOfDay("foo");
import { startOfDay } from "https://esm.sh/[email protected]";

// No error?
let foo = startOfDay("foo");
I can see that they use declare module in their typings file, is this causing the issue?
7 replies
SSolidJS
Created by Ciantic on 12/6/2022 in #support
How to use Hash Mode Router in SolidStart?
I think this is not possible at the moment, as properties for StartRouter isn't configurable, but I'd prefer hash mode routing for SPA.
14 replies