hprose / hprose-typescript

Hprose 3.0 for TypeScript
MIT License
59 stars 9 forks source link

Use hprose in React issue. #16

Open MiyamuraMiyako opened 3 years ago

MiyamuraMiyako commented 3 years ago
  1. npm i --S @hprose/html5
  2. import * as hprose from '@hprose/html5';
    const client = new hprose.Client('http://127.0.0.1:8255');

then: TypeError: _hprose_rpc_html5__WEBPACK_IMPORTED_MODULE_4__.Client is not a constructor.

MiyamuraMiyako commented 3 years ago

This code Unhandled Rejection (Error): The protocol "http:" is not supported.:

import * as hprose from '@hprose/rpc-core';
import '@hprose/rpc-html5';

const moduleClient = new hprose.Client('http://127.0.0.1:8412');