tnfe / FFCreator

A fast video processing library based on node.js (一个基于node.js的高速视频制作库)
http://tnfe.github.io/FFCreator/
MIT License
2.86k stars 406 forks source link

Support for Bun #445

Open nachat-ayoub opened 1 month ago

nachat-ayoub commented 1 month ago

The library does not work with running it with bun, i get this error:

error: The module 'webgl' was compiled against a different Node.js ABI version using NODE_MODULE_VERSION 108. This version of Bun requires NODE_MODULE_VERSION 127. Please try re-compiling or re-installing the module.

  at bindings (./elysia-app/node_modules/bindings/bindings.js:112:48)
  at ./elysia-app/node_modules/gl/src/javascript/native-gl.js:1:7
  at ./elysia-app/node_modules/gl/src/javascript/webgl-rendering-context.js:4:42
  at ./elysia-app/node_modules/gl/src/javascript/node-index.js:3:32

  at ./elysia-app/node_modules/inkpaint/lib/polyfill/Doc.js:8:15

  at ./elysia-app/node_modules/inkpaint/lib/polyfill/Doc.js:8:15  
  at ./elysia-app/node_modules/inkpaint/lib/renderers/SystemRenderer.js:11:12
  at ./elysia-app/node_modules/inkpaint/lib/renderers/canvas/Ca5
  at ./elysia-app/node_modules/inkpaint/lib/polyfill/Doc.js:8:15  
  at ./elysia-app/node_modules/inkpaint/lib/renderers/SystemRenderer.js:11:12
  at ./elysia-app/node_modules/inkpaint/lib/renderers/canvas/Ca5

  at ./elysia-app/node_modules/inkpaint/lib/polyfill/Doc.js:8:15
  at ./elysia-app/node_modules/inkpaint/lib/renderers/SystemRenderer.js:11:12
  at ./elysia-app/node_modules/inkpaint/lib/renderers/canvas/CanvasRenderer.js:7:23
  at ./elysia-app/node_modules/inkpaint/lib/core.js:318:23
  at ./elysia-app/node_modules/inkpaint/lib/index.js:480:5
  at ./elysia-app/node_modules/ffcreator/lib/node/cons.js:16:20
  at ./elysia-app/node_modules/ffcreator/lib/creator.js:23:7
drawcall commented 1 month ago

This error occurs because the Node WebGL module you are using is compiled for a different Node.js ABI version, while the current version of Bun you are using requires a different ABI version. try 'npm rebuild gl'

nachat-ayoub commented 1 month ago

@drawcall I did that and still getting the same error. can you try running a ts file that uses the FFCreator package with bun and update me with a solution?

i even tried using this command:

$env:npm_config_target = 'v21.7.3';
> bun install

but got this error:

error: Could not locate the bindings file. Tried:
 → C:\Users\...\elysia-app\node_modules\gl\build\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\build\Debug\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\build\Release\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\out\Debug\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\Debug\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\out\Release\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\Release\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\build\default\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\compiled\22.6.0\win32\x64\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\addon-build\release\install-root\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\addon-build\debug\install-root\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\addon-build\default\install-root\webgl.node
 → C:\Users\...\elysia-app\node_modules\gl\lib\binding\node-v127-win32-x64\webgl.node
      at bindings (C:\Users\...\elysia-app\node_modules\bindings\bindings.js:126:9)
      at C:\Users\...\elysia-app\node_modules\gl\src\javascript\native-gl.js:1:7
      at C:\Users\...\elysia-app\node_modules\gl\src\javascript\webgl-rendering-context.js:4:42
      at C:\Users\...\elysia-app\node_modules\gl\src\javascript\node-index.js:3:32
      at C:\Users\...\elysia-app\node_modules\gl\index.js:4:10
      at C:\Users\...\elysia-app\node_modules\inkpaint\lib\canvas-gl.js:120:11
      at C:\Users\...\elysia-app\node_modules\inkpaint\lib\polyfill\Canvas.js:7:5
      at C:\Users\...\elysia-app\node_modules\inkpaint\lib\polyfill\Doc.js:8:15
      at C:\Users\...\elysia-app\node_modules\inkpaint\lib\renderers\SystemRenderer.js:11:12
      at C:\Users\...\elysia-app\node_modules\inkpaint\lib\renderers\canvas\CanvasRenderer.js:7:23
      at C:\Users\...\elysia-app\node_modules\inkpaint\lib\core.js:318:23
      at C:\Users\...\elysia-app\node_modules\inkpaint\lib\index.js:480:5
      at C:\Users\...\elysia-app\node_modules\ffcreator\lib\node\cons.js:16:20
      at C:\Users\...\elysia-app\node_modules\ffcreator\lib\creator.js:23:7
      at C:\Users\...\elysia-app\node_modules\ffcreator\lib\index.js:14:7

Bun v1.1.29 (Windows x64)
Nodejs v21.7.3
drawcall commented 1 month ago

Sorry, too busy at work. try again later.

nachat-ayoub commented 1 month ago

Sorry, too busy at work. try again later.

Thanks for replying, i will wait until Bun team support the nodejs latest version.

drawcall commented 1 month ago

or cd node_modules/gl node-gyp rebuild