Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demos throw type error #17

Open
robinsonkwame opened this issue Apr 16, 2019 · 1 comment
Open

Demos throw type error #17

robinsonkwame opened this issue Apr 16, 2019 · 1 comment

Comments

@robinsonkwame
Copy link

robinsonkwame commented Apr 16, 2019

Checking out master and running demos gives,

bash-3.2$ yarn install
bash-3.2$ yarn compile
bash-3.2$ yarn demos
yarn run v1.15.2
$ yarn ts ./scripts/demos.ts
$ cross-env NODE_ENV=test ts-node -r tsconfig-paths/register -P tsconfig.all.json ./scripts/demos.ts

.../core/node_modules/ts-node/src/index.ts:253
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
scripts/demos.ts(19,3): error TS2345: Argument of type '{ stdio: string; cwd: string; }' is not assignable to parameter of type 'SpawnOptions'.
  Types of property 'stdio' are incompatible.
    Type 'string' is not assignable to type 'StdioOptions'.

    at createTSError (.../core/node_modules/ts-node/src/index.ts:253:12)
    at getOutput (.../core/node_modules/ts-node/src/index.ts:363:40)
    at Object.compile (.../core/node_modules/ts-node/src/index.ts:551:11)
    at Module.m._compile (.../core/node_modules/ts-node/src/index.ts:435:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Object.require.extensions.(anonymous function) [as .ts] (.../core/node_modules/ts-node/src/index.ts:438:12)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command

yet all tests pass successfully.

@paomancia
Copy link

I'm getting the same error when I run yarn demos :( I tried downgrading some dependencies like typescript and ts-node but no luck.

By the way, I'm on a laptop with Ubuntu 18.04.2 LTS and this is my package.json file:

{ "name": "@haiku/core", "version": "4.5.2", "description": "Haiku Core is a JavaScript library for building user interfaces", "homepage": "https://www.haikuforteams.com", "directories": { "lib": "lib", "dom": "dom", "components": "components", "dist": "dist" }, "keywords": [ "animation", "motion", "component", "web", "browser", "svg", "rendering", "engine" ], "repository": "https://github.com/HaikuTeam/core", "main": "index.js", "scripts": { "lint": "tslint --exclude 'src/vendor/**' -p tsconfig.all.json -t stylish", "lint-report": "yarn lint -t checkstyle -o checkstyle-result.xml", "fix": "yarn lint --fix", "ts": "cross-env NODE_ENV=test ts-node -r tsconfig-paths/register -P tsconfig.all.json", "test": "yarn ts ./node_modules/.bin/tape 'test/**/*.test.ts' | tap-spec", "test-report": "nyc yarn ts ./node_modules/.bin/tape 'test/**/*.test.ts' > test-result.tap", "compile": "tsc", "develop": "tsc --watch", "bundle": "yarn compile && yarn ts ./scripts/bundle.ts", "demos": "yarn ts ./scripts/demos.ts" }, "authors": [ "Matthew Trost <matthew@haiku.ai>", "Zack Brown <zack@haiku.ai>", "Taylor Poe <taylor@haiku.ai>", "Sasha Joseph <sasha@haiku.ai>" ], "license": "MIT", "devDependencies": { "@angular/core": "^6.0.9", "async": "^2.5.0", "chokidar": "^1.7.0", "cross-env": "^5.1.6", "depcheck": "^0.6.7", "express": "4.14.1", "filesize": "3.5.10", "fs-extra": "^4.0.2", "haiku-testing": "4.5.2", "handlebars": "^4.0.8", "istanbul-reporter-cobertura-haiku": "^1.0.2", "jsdom": "^11.1.0", "leaked-handles": "^5.2.0", "nodemon": "1.11.0", "nyc": "^13.0.1", "opn": "^5.3.0", "react": "^16.0.0", "react-dom": "^16.0.0", "react-router-dom": "^4.1.1", "rollup": "^0.53.3", "rollup-plugin-commonjs": "^8.2.6", "rollup-plugin-json": "^2.3.0", "rollup-plugin-node-resolve": "^3.0.0", "rollup-plugin-uglify-es": "^0.0.1", "rxjs": "^6.3.3", "tap-spec": "^4.1.2", "tape": "^4.9.0", "ts-loader": "^4.4.2", "ts-node": "^6.1.0", "tsconfig-paths": "^3.3.2", "tslint": "^5.11.0", "tslint-config-haiku": "^1.0.16", "tslint-no-circular-imports": "^0.5.0", "typescript": "^3.0.3", "webpack": "^4.16.0", "webpack-cli": "^3.0.8" }, "peerDependencies": { "@angular/core": "^6.0.9", "react": "^16.0.0 || ^15.4.2", "react-dom": "^16.0.0 || ^15.4.2" }, "dependencies": { "@haiku/core": "^4.5.2" } }

in the meantime if you want to checkout the demos, you can try running the server manually. This is what I did that might work for you as well:

  1. Clone the repository locally.
  2. Run yarn install
  3. Run yarn add @haiku/core
  4. Run node demo/server.js
  5. On your browser go to http://localhost:3000/ and you'll see the list of demos.

Important: Make sure to install the @haiku/core (step 3) otherwise the demos won't run and this error will be shown: throw new Error('webpack compile had errors'); . To make sure it is installed check your package.json file, the dependency should be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants