Errors when running yarn run commands
Swader opened this issue · 4 comments
Platform: Windows, Git Bash
Newest NodeJS, NPM, Yarn
Running yarn run start
produces:
> cross-env BABEL_ENV=node babel src --copy-files --extensions ".js,.ts" --out-d
ir dist --source-maps "--verbose" "--watch"
src/constants.ts:1:1 - error TS1208: Cannot compile namespaces when the '--isola
tedModules' flag is provided.
1 enum Topics {
~~~~
src/index.ts:4:23 - error TS2306: File 'C:/Users/Bruno/repos/status-js/src/const
ants.ts' is not a module.
4 import constants from "./constants.js";
~~~~~~~~~~~~~~~~
src/index.ts:6:54 - error TS2339: Property 'web3' does not exist on type 'Window
'.
6 const Web3 = typeof window !== 'undefined' && window.web3 ? new web3Lib(window
.web3.currentProvider) : web3Lib;
~~~~
src/index.ts:6:80 - error TS2339: Property 'web3' does not exist on type 'Window
'.
6 const Web3 = typeof window !== 'undefined' && window.web3 ? new web3Lib(window
.web3.currentProvider) : web3Lib;
~~~~
src/index.ts:49:66 - error TS2345: Argument of type '{ headers: { Origin: string
; }; }' is not assignable to parameter of type 'number'.
49 web3.setProvider(new Web3.providers.WebsocketProvider(url, {headers: {O
rigin: "statusjs"}}));
~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~
src/mailservers.ts:1:23 - error TS2306: File 'C:/Users/Bruno/repos/status-js/src
/constants.ts' is not a module.
1 import constants from "./constants.js";
~~~~~~~~~~~~~~~~
[10:33:46 AM] Found 6 errors. Watching for file changes.
When running yarn run lint
I get:
$ tslint -c tslint.json 'src/**/*.ts'
ERROR: src/index.ts:6:32 - ' should be "
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.
ERROR: "lint:ts" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.
With the latest commit you should be able to execute yarn build
and obtain a valid executable.
There's only one error remaining:
~~~~
src/index.ts:49:66 - error TS2345: Argument of type '{ headers: { Origin: string
; }; }' is not assignable to parameter of type 'number'.
49 web3.setProvider(new Web3.providers.WebsocketProvider(url, {headers: {O
rigin: "statusjs"}}));
~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~
but it should not affect the building process. Once this is fixed, I'll close the issue!
Succeeded in running it now with only that one error remaining, but not getting any executable, only JS files with their sourcemaps in dist. What should I try running after this? @richard-ramos
Oops, yeah, instead of executable I should have said JS files. This project generates the scripts necessary to build a status client. You can find it the npm package here: https://www.npmjs.com/package/status-js-api.
This npm package is used in:
- https://github.com/status-im/status-x/ Command line chat client
- https://github.com/status-im/status-js-desktop Javascript client (using electron)
- https://github.com/status-im/chat Web client.
Sorry for the confusion, @Swader !
clone the repo via git: ``` $ git clone https://github.com/status-im/status-js.git ``` And then install the dependencies with `yarn`. ``` $ cd status-js $ yarn ```
Status Command Line Chat Client (WIP) . Contribute to status-im/status-x development by creating an account on GitHub.
A Status client reference implementation using status-js - status-im/status-js-desktop
status in the browser. Contribute to status-im/chat development by creating an account on GitHub.
Thank you!