Closed malikov917 closed 5 years ago
@malikov917 no need to import. 'types' settings in tsconfig is all right.
@qianbin then how to use connex inside a project?
even after
declare const connex;
I'm getting:
ERROR ReferenceError: connex is not defined
I'm not familiar with angular, while you can check the tips at https://github.com/vechain/connex#typescript-complier-does-not-find-connex
@qianbin I've tried this tips without result
Have you tried to remove typeRoots
in tsconfig.json?
@qianbin hm I need it for
"typeRoots": [ "node_modules/@types" ]
that's for others 'types'
try upgrade typescript to latest release
@qianbin Ok, update up to "typescript": "3.4.5" (latest), still getting same issue
File '.../node_modules/@vechain/connex/index.d.ts' is not a module.
@malikov917 Remove the line import {Connex} from '@vechain/connex';
@qianbin but how can I use 'connex' inside a project? connex is undefined
@qianbin thank you for your support, actually I've figured out how to make it work. In 10 minutes I'll leave a short review and "close and comment" 💯
@malikov917 :-) wondering how
@qianbin I appreciate your support, well the solution was:
Work via Sync App
NOT to import it via:
import {Connex} from '@vechain/connex';
Just declare it like:
declare const window; declare const connex;
Rest of things are described in dev tips in instruction on Connex; That was a bit strange for me that I don't need to import Connex into my project and this thing is happening automatically;
@qianbin hm I just thought one more time on that and decided that usage of Typescript is impossible still. I'm supposing that this issue still has a sense
hi, I have angular 5 project and currently face with a problem:
in my app.component.ts
import {Connex} from '@vechain/connex'; _nodemodules/@vechain/connex/index.d.ts' is not a module
tsconfig.app.json is:
tsconfig.json
in addition:
ERROR in node_modules/@vechain/connex/index.d.ts(438,19): error TS1005: ';' expected. node_modules/@vechain/connex/index.d.ts(439,19): error TS1005: ';' expected. node_modules/@vechain/connex/index.d.ts(447,19): error TS1005: '>' expected. node_modules/@vechain/connex/index.d.ts(448,19): error TS1005: ';' expected. node_modules/@vechain/connex/index.d.ts(449,9): error TS1109: Expression expected. node_modules/@vechain/connex/index.d.ts(540,15): error TS1005: ';' expected. node_modules/@vechain/connex/index.d.ts(541,15): error TS1005: ';' expected.
Angular CLI: 1.7.4 Node: 8.11.2 OS: win32 x64 Angular: 5.2.11 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router
@angular/cli: 1.7.4 @angular-devkit/build-optimizer: 0.3.2 @angular-devkit/core: 0.3.2 @angular-devkit/schematics: 0.3.2 @ngtools/json-schema: 1.2.0 @ngtools/webpack: 1.10.2 @schematics/angular: 0.3.2 @schematics/package-update: 0.3.2 typescript: 2.5.3 webpack-raphael: 2.1.4 webpack: 3.11.0