Skip to content

fix(Exchange): handle binary msgs in browser and load protobufjs#27629

Merged
carlosmiei merged 2 commits intoccxt:masterfrom
carlosmiei:mexc-browser-fix
Jan 6, 2026
Merged

fix(Exchange): handle binary msgs in browser and load protobufjs#27629
carlosmiei merged 2 commits intoccxt:masterfrom
carlosmiei:mexc-browser-fix

Conversation

@carlosmiei
Copy link
Collaborator

@carlosmiei carlosmiei self-assigned this Jan 6, 2026
@carlosmiei carlosmiei changed the title fix(Exchange): handle binary msgs in browser fix(Exchange): handle binary msgs in browser and load protobufjs Jan 6, 2026
@carlosmiei
Copy link
Collaborator Author

MExc orderbook working on the browser
image

@carlosmiei carlosmiei merged commit d9cd974 into ccxt:master Jan 6, 2026
6 of 11 checks passed
@allenchuang
Copy link

This is not workin in the latest ccxt npm version https://www.npmjs.com/package/ccxt/v/4.5.32

Getting the following:

## Error Type
Build Error

## Error Message
Module not found: Can't resolve 'protobufjs/minimal'

## Build Output
./node_modules/.pnpm/ccxt@4.5.32/node_modules/ccxt/js/src/protobuf/mexc/compiled.cjs:9:17
Module not found: Can't resolve 'protobufjs/minimal'
   7 | /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
   8 | "use strict";
>  9 | var $protobuf = require("protobufjs/minimal");
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  10 | // Common aliases
  11 | var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
  12 | // Exported root namespace

Import traces:
  Client Component Browser:
    ./node_modules/.pnpm/ccxt@4.5.32/node_modules/ccxt/js/src/protobuf/mexc/compiled.cjs [Client Component Browser]
    ./node_modules/.pnpm/ccxt@4.5.32/node_modules/ccxt/js/src/base/Exchange.js [Client Component Browser]
    ./node_modules/.pnpm/ccxt@4.5.32/node_modules/ccxt/js/ccxt.js [Client Component Browser]
    ./apps/web/lib/ccxt-client.ts [Client Component Browser]
    ./apps/web/context/HyperliquidContext.tsx [Client Component Browser]
    ./apps/web/context/HyperliquidContext.tsx [Server Component]
    ./apps/web/app/layout.tsx [Server Component]

  Client Component SSR:
    ./node_modules/.pnpm/ccxt@4.5.32/node_modules/ccxt/js/src/protobuf/mexc/compiled.cjs [Client Component SSR]
    ./node_modules/.pnpm/ccxt@4.5.32/node_modules/ccxt/js/src/base/Exchange.js [Client Component SSR]
    ./node_modules/.pnpm/ccxt@4.5.32/node_modules/ccxt/js/ccxt.js [Client Component SSR]
    ./apps/web/lib/ccxt-client.ts [Client Component SSR]
    ./apps/web/context/HyperliquidContext.tsx [Client Component SSR]
    ./apps/web/context/HyperliquidContext.tsx [Server Component]
    ./apps/web/app/layout.tsx [Server Component]

https://nextjs.org/docs/messages/module-not-found

Next.js version: 16.1.0 (Turbopack)

image

@carlosmiei
Copy link
Collaborator Author

@allenchuang Are you using the browserified version of ccxt?

@wa1one
Copy link

wa1one commented Jan 15, 2026

@carlosmiei I can confirm the issue is fixed. Other watch API fixed as well.

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 this pull request may close these issues.

3 participants