InjectiveLabs / injective-ts

Collection of TypeScript packages that consume and interact with the Injective Chain
Apache License 2.0
130 stars 193 forks source link

grpc-web: Importing as ESModule in Node #273

Open cd3367 opened 10 months ago

cd3367 commented 10 months ago

/@injectivelabs+sdk-ts@1.14.4_debug@4.3.4/node_modules/@injectivelabs/sdk-ts/dist/esm/client/BaseGrpcConsumer.js:1

import { grpc } from '@injectivelabs/grpc-web'; ^^^^ SyntaxError: Named export 'grpc' not found. The requested module '@injectivelabs/grpc-web' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@injectivelabs/grpc-web'; const { grpc } = pkg;

bangjelkoski commented 10 months ago

There is something off in your setup. We are using this in a lot of projects ourselves and have had no issues so far.

cd3367 commented 10 months ago

repro

https://stackblitz.com/edit/stackblitz-starters-p83jpp?file=repro.ts

Any solutions?