SolidJS + PocketBase not working ?

Hi, I'm trying to make a project using SolidJS (SolidStart) + PocketBase as the backend. But it seems like I can't even import the client library. I get this error:
✘ [ERROR] Unexpected "\x7f" pocketbase:1:0: 1 │ ELF>�G@�@8@@@@... ╵ ^ 3:30:00 PM [vite] (client) error while updating dependencies: Error: Build failed with 1 error: pocketbase:1:0: ERROR: Unexpected "\x7f" at failureErrorWithLog (node_modules/esbuild/lib/main.js:1467:15) at node_modules/esbuild/lib/main.js:926:25 at node_modules/esbuild/lib/main.js:1345:9 at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
My App:
import { A } from "@solidjs/router";
import Counter from "~/components/Counter";

import PocketBase from 'pocketbase';

const pb = new PocketBase('http://127.0.0.1:8090');

export default function Home() {


const onLogin = async () => {
try {
const authData = await pb.collection('users').authWithOAuth2({ provider: 'google' });
console.log('Logged in successfully:', authData);
} catch (error) {
console.error('Login failed:', error);
}
};

return (
<main class="text-center mx-auto text-gray-700 p-4">
<h1 class="max-6-xs text-6xl text-sky-700 font-thin uppercase my-16">Hello world!</h1>
<Counter />
<button onClick={onLogin} class="bg-sky-600 text-white px-4 py-2 rounded hover:bg-sky-700">
Login with Google
</button>
<p class="mt-8">
Visit{" "}
<a href="https://solidjs.com" target="_blank" class="text-sky-600 hover:underline">
solidjs.com
</a>{" "}
to learn how to build Solid apps.
</p>
<p class="my-4">
<span>Home</span>
{" - "}
<A href="/about" class="text-sky-600 hover:underline">
About Page
</A>{" "}
</p>
</main>
);
import { A } from "@solidjs/router";
import Counter from "~/components/Counter";

import PocketBase from 'pocketbase';

const pb = new PocketBase('http://127.0.0.1:8090');

export default function Home() {


const onLogin = async () => {
try {
const authData = await pb.collection('users').authWithOAuth2({ provider: 'google' });
console.log('Logged in successfully:', authData);
} catch (error) {
console.error('Login failed:', error);
}
};

return (
<main class="text-center mx-auto text-gray-700 p-4">
<h1 class="max-6-xs text-6xl text-sky-700 font-thin uppercase my-16">Hello world!</h1>
<Counter />
<button onClick={onLogin} class="bg-sky-600 text-white px-4 py-2 rounded hover:bg-sky-700">
Login with Google
</button>
<p class="mt-8">
Visit{" "}
<a href="https://solidjs.com" target="_blank" class="text-sky-600 hover:underline">
solidjs.com
</a>{" "}
to learn how to build Solid apps.
</p>
<p class="my-4">
<span>Home</span>
{" - "}
<A href="/about" class="text-sky-600 hover:underline">
About Page
</A>{" "}
</p>
</main>
);
4 Replies
Cyber Grandma
Cyber GrandmaOP2w ago
Okay I'm stupid (well not totally), I have the pocketbase binary literally named pocketbase in my folder. And for some reason it is what it tries to "import" (which obviously wont work). It's pretty dumb that it doesn't prioritize the node package literally named like that lmao.
bigmistqke
bigmistqke6d ago
oof that's a rough bug. good catch!
Cyber Grandma
Cyber GrandmaOP5d ago
Do you think I should report this issue ? I don't even know if that would be a solid start or vinxi or vite issue.
bigmistqke
bigmistqke5d ago
no, i don't think there is anything to even report it's working as expected it's just unexpected how the expected is working 🙂 i really dislike those imports from root but they are part of the semantics of an url, so not much you can do about it and the module resolution will prefer local over external modules

Did you find this page helpful?