Skip to content
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

Unable to run on windows with node 20 #2

Open
Keref opened this issue Jun 21, 2024 · 1 comment
Open

Unable to run on windows with node 20 #2

Keref opened this issue Jun 21, 2024 · 1 comment

Comments

@Keref
Copy link

Keref commented Jun 21, 2024

Hi, I fail to run anything from peerbit, I think there's a bunch of undocumented configuration but being not too comfortable with typescript I fail to solve things.

This getting-started example fails: jest fails on windows, it seems a known issue, so I figured I'd run simply yarn build.
It wants a missing dependency, @peerbit/program

Then it fails with

src/index.test.ts:33:38 - error TS2345: Argument of type 'MyDatabase' is not assignable to parameter of type 'string | Program<never, ProgramEvents>'.
  Type 'MyDatabase' is not assignable to type 'Program<never, ProgramEvents>'.
    Types have separate declarations of a private property '_node'.

33         const db = await client.open(new MyDatabase());

I figured I'd try to make a peerbit app with a vanilla nextjs, I put this index.ts into a file and import + console.log it: I get

Error: No native build was found for platform=win32 arch=x64 runtime=node abi=115 uv=1 libc=glibc node=20.11.0 webpack=true
    loaded from: D:\***\.next\server\vendor-chunks

I have tried the peerbit examples too, nothing works, so I reckon it may be that node 20 isnt supported?

Long story short, how can I use peerbit in practice?
Also, how can I run in practice the first example from the doc?

@marcus-pousette
Copy link
Member

Hi! thanks for creating this isssue, and a slow reply from my side.

rc/index.test.ts:33:38 - error TS2345: Argument of type 'MyDatabase' is not assignable to parameter of type 'string | Program<never, ProgramEvents>'.
Type 'MyDatabase' is not assignable to type 'Program<never, ProgramEvents>'.
Types have separate declarations of a private property '_node'.

33 const db = await client.open(new MyDatabase());

Sounds like a dependency version issue, or something like that. Have you tried running the tests in the getting started repo?

Interesting that it does not work on windows. Though I am not actively working on windows nor have it part of the build test pipeline, but judging from

Error: No native build was found for platform=win32 arch=x64 runtime=node abi=115 uv=1 libc=glibc node=20.11.0 webpack=true
loaded from: D:***.next\server\vendor-chunks

it is hard to know whether this is Peerbit related? 

What I am more looking for is the exact dependency that does not have a native build for your platform? Usually problematic dependencies are those that depend on native builds (usually crypto libs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants