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

Uncaught TypeError: Invalid FFI pointer type, expected null, integer or BigInt #55

Closed
tylerchilds opened this issue Oct 1, 2022 · 1 comment · Fixed by #58
Closed

Comments

@tylerchilds
Copy link

Trying to run the hello.ts example, but getting an error, pasted below. This happens on multiple machines on the latest deno. The most recent version of deno I have laying around where the code works is 1.23.2.

tychi@pop-os:~/SourceCode/deno_sdl2$ deno run --allow-ffi --unstable examples/hello.ts --no-check
⚠️  ️Deno requests env access to "DENO_SDL2_PATH". Run again with --allow-env to bypass this prompt.
   Allow? [y/n (y = yes allow, n = no deny)]  y
SDL2 initialized on Linux
error: Uncaught TypeError: Invalid FFI pointer type, expected null, integer or BigInt
    const window = sdl2.symbols.SDL_CreateWindow(
                                ^
    at Object.eval [as SDL_CreateWindow] (eval at DynamicLibrary (deno:ext/ffi/00_ffi.js:366:34), <anonymous>:4:13)
    at WindowBuilder.build (file:///home/tychi/SourceCode/deno_sdl2/mod.ts:956:33)
    at file:///home/tychi/SourceCode/deno_sdl2/examples/hello.ts:4:60
tychi@pop-os:~/SourceCode/deno_sdl2$ 
@AngelGamer29JA
Copy link

AngelGamer29JA commented Oct 27, 2022

I've been trying to fix this error and it happens on line 62, in parameters where pointer should be buffer

  "SDL_CreateWindow": {
    "parameters": [
      "pointer", // <--- this line should be replaced by "buffer"
      "i32",

denoland/deno_bindgen#87 (comment)

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

Successfully merging a pull request may close this issue.

2 participants