-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with Bun #79
Comments
Thanks I’m keen to try bun and get this working.
From the error it looks like the SQLite dependency isn’t supported.
…On Sat, 9 Sep 2023 at 9:55 pm, vaaski ***@***.***> wrote:
*Describe the bug*
After bun <https://bun.sh> hit v1.0.0 yesterday I was eager to give it a
spin, but unfortunately this package doesn't seem to work right out of the
box. Not sure what the cause is, but if I find some time I might look into
it.
error log
bunx pocketbase-typegen --db pb_data/data.db --out plugins/pocketbase-types.ts
node:internal/modules/cjs/loader:995
const err = new Error(message);
^
Error: Cannot find module ***@***.***/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-arm64/node_sqlite3.node'
Require stack:
- ***@***.***/node_modules/sqlite3/lib/sqlite3-binding.js
- ***@***.***/node_modules/sqlite3/lib/sqlite3.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> ***@***.***/node_modules/sqlite3/lib/sqlite3-binding.js:4:17)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
***@***.***/node_modules/sqlite3/lib/sqlite3-binding.js',
***@***.***/node_modules/sqlite3/lib/sqlite3.js'
]
}
Node.js v18.12.1
error: "pocketbase-typegen" exited with code 1 (SIGHUP)
*Versions*
pocketbase-typegen version: 1.1.13
pocketbase version: 0.18.1
—
Reply to this email directly, view it on GitHub
<#79>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6YGPCS6MCWZLU47L2RDNTXZRN4TANCNFSM6AAAAAA4RNH37U>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Glad to hear you're interested as well! Looks like it might even be possible to use bun test output
Even running each test 100 times is still multiple times faster than jest :D |
It was actually rather simple to get running, however I did run into some issues.
I think ideally there shouldn't be multiple binaries separating the two runtimes, but I'm not sure how to work that into your build setup. |
I just tried to reproduce this with bun v1.0.1 and it worked without errors. These all seem like issues that could be fixed on the bun side. Can you try again with the newer version of bun? I'm also on Mac OSX 12.6.5 |
It doesn't work for me using bun 1.0.2 on an M2 Mac, OSX v13.5.2 I'm trying to run it as a package.json script
And it's throwing:
|
Looks like my issue was Mac Silicon-related. Running this got it to work.
I'm not sure what the bun version of that command is, though. |
I just tried it and i could not get it to work. Here's what I did:
added the following script to my package.json and ran which yielded I'm on bun 1.0.7 |
@jakubdonovan The command for running package.json scripts for your case would be Whats confusing is that the package entry point does have a node shebang The reason I couldn't repro earlier is because it only errors when trying to generate with the database option. |
bun run typegen resulted in [Error: SQLITE_CANTOPEN: unable to open database file] { Node.js v20.3.0 |
@patmood I was able to get it to work by running
res is of type any and not MenusResponse and each collection in TypedPocketBase gives me the following warning whereas removing This is problematic because I now need to do extra stuff to also get the system fields for say my RecipesRecord.
now gives me Property 'id' does not exist on type 'MenusRecord'.ts(2339) |
did you manage to get it to run with the built in sqlite?
|
@jakubdonovan if you are using As mentioned above, bun seems to work after installing the sqlite package for apple silicon. I'm not sure if that is bun related though
|
That's right, looks like I was on an older version of pocketbase. As for sqlite, how'd you install the apple silicon compatible version? |
I'm using bun v1.1.8 on Windows and runing |
Describe the bug
After bun hit v1.0.0 yesterday I was eager to give it a spin, but unfortunately this package doesn't seem to work right out of the box. Not sure what the cause is, but if I find some time I might look into it.
error log
Versions
pocketbase-typegen version: 1.1.13
pocketbase version: 0.18.1
edit
probably related to oven-sh/bun#158
The text was updated successfully, but these errors were encountered: