cycle-onionify icon indicating copy to clipboard operation
cycle-onionify copied to clipboard

cannot compile typescript examples

Open jopek opened this issue 7 years ago • 1 comments

steps to reproduce:

  • git clone https://github.com/staltz/cycle-onionify.git
  • npm i
  • npm run lib
  • cd examples/lenses/
  • npm start

node 8.1.4 npm 6.4.1

alex@alexs-mbp : ~/dev/learn/cyclejs
[0] % git clone https://github.com/staltz/cycle-onionify.git
Cloning into 'cycle-onionify'...
[...]

alex@alexs-mbp : ~/dev/learn/cyclejs
[0] % cd cycle-onionify

alex@alexs-mbp ‹ master › : ~/dev/learn/cyclejs/cycle-onionify
[0] % npm i

> [email protected] install /Users/alex/dev/learn/cyclejs/cycle-onionify/node_modules/fsevents
> node install

[fsevents] Success: "/Users/alex/dev/learn/cyclejs/cycle-onionify/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm notice created a lockfile as package-lock.json. You should commit this file.
added 580 packages from 203 contributors and audited 2610 packages in 20.678s
found 0 vulnerabilities


alex@alexs-mbp ‹ master ● › : ~/dev/learn/cyclejs/cycle-onionify
[0] % npm run lib

> [email protected] prelib /Users/alex/dev/learn/cyclejs/cycle-onionify
> mkdir -p lib


> [email protected] lib /Users/alex/dev/learn/cyclejs/cycle-onionify
> tsc


alex@alexs-mbp ‹ master ● › : ~/dev/learn/cyclejs/cycle-onionify
[0] % cd examples/lenses/

alex@alexs-mbp ‹ master ● › : ~/dev/learn/cyclejs/cycle-onionify/examples/lenses
[0] % l
total 24
-rw-r--r--  1 alex  staff  366 Oct  6 12:17 index.html
-rw-r--r--  1 alex  staff  695 Oct  6 12:17 package.json
drwxr-xr-x  6 alex  staff  204 Oct  6 12:17 src
-rw-r--r--  1 alex  staff  385 Oct  6 12:17 tsconfig.json

alex@alexs-mbp ‹ master ● › : ~/dev/learn/cyclejs/cycle-onionify/examples/lenses
[0] % npm start

> [email protected] start /Users/alex/dev/learn/cyclejs/cycle-onionify/examples/lenses
> npm install && npm run browserify && echo 'OPEN index.html IN YOUR BROWSER'

npm notice created a lockfile as package-lock.json. You should commit this file.
added 160 packages from 194 contributors and audited 1040 packages in 15.377s
found 0 vulnerabilities


> [email protected] prebrowserify /Users/alex/dev/learn/cyclejs/cycle-onionify/examples/lenses
> mkdirp dist && tsc

src/Edit.ts(42,3): error TS2322: Type '{ DOM: MemoryStream<VNode>; onion: Stream<Reducer>; }' is not assignable to type 'Sinks'.
  Types of property 'DOM' are incompatible.
    Type 'MemoryStream<VNode>' is not assignable to type 'Stream<VNode>'.
      Property '_ils' is protected but type 'Stream<T>' is not a class derived from 'Stream<T>'.
src/Item.ts(38,3): error TS2322: Type '{ DOM: MemoryStream<VNode>; onion: Stream<(prevState: State) => State>; }' is not assignable to type 'Sinks'.
  Types of property 'DOM' are incompatible.
    Type 'MemoryStream<VNode>' is not assignable to type 'Stream<VNode>'.
src/main.ts(7,23): error TS2345: Argument of type '(sources: Sources) => Sinks' is not assignable to parameter of type 'MainFn<Sources, OSi<{}>>'.
  Type 'Sinks' is not assignable to type 'OSi<{}>'.
    Types of property 'onion' are incompatible.
      Type 'Stream<Reducer>' is not assignable to type 'Stream<Reducer<{}>>'.
        Property '_ils' is protected but type 'Stream<T>' is not a class derived from 'Stream<T>'.

npm ERR! code ELIFECYCLE
[...]

jopek avatar Oct 06 '18 12:10 jopek

Possibly related? https://github.com/cyclejs/cyclejs/tree/master/examples/intermediate/bmi-typescript works as is, but attempting to upgrade TypeScript to "2.5" or higher in package.json produces the same error.

fasiha avatar Oct 08 '18 01:10 fasiha