unsphereU
Convex Community16mo ago
3 replies
unsphere

How to use Buffer in httpRouter?

Some npm packages I need rely on Buffer and I am already using "use node" for convexAuth ConvexCredentials that is working fine. But then I get the following error:

InvalidModules: Hit an error while pushing:
Loading the pushed modules encountered the following
    error:
Failed to analyze http.js: Uncaught ReferenceError: Buffer is not defined
    at node_modules/@ton/core/dist/boc/BitString.js (../../node_modules/@ton/core/dist/boc/BitString.js:167:53)
    at __require2 (convex:/_deps/225NMHCD.js:16:50)
    at node_modules/@ton/core/dist/boc/BitBuilder.js (../../node_modules/@ton/core/dist/boc/BitBuilder.js:16:0)
    at __require2 (convex:/_deps/225NMHCD.js:16:50)
    at node_modules/@ton/core/dist/boc/Builder.js (../../node_modules/@ton/core/dist/boc/Builder.js:11:15)
    at __require2 (convex:/_deps/225NMHCD.js:16:50)
    at node_modules/@ton/core/dist/address/contractAddress.js (../../node_modules/@ton/core/dist/address/contractAddress.js:11:6)
    at __require2 (convex:/_deps/225NMHCD.js:16:50)
    at node_modules/@ton/core/dist/index.js (../../node_modules/@ton/core/dist/index.js:33:22)
    at __require2 (convex:/_deps/225NMHCD.js:16:50)


Using "use node" inside of the httpRouter file where the ConvexAuth http actions will be consumed is not allowed.

"use node" directive is not allowed for http.ts.


Any idea?
Was this page helpful?