hprose-typescript
hprose-typescript copied to clipboard
Use hprose in React issue.
-
npm i --S @hprose/html5
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
.
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');