leebenson / reactql

Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
https://reactql.org
MIT License
1.82k stars 174 forks source link

TSError: ⨯ Unable to compile TypeScript #153

Closed gajus closed 5 years ago

gajus commented 5 years ago

Simple NPM install and npm run dev:static gives an error:

npm run dev:static

> reactql@4.2.1 dev:static /Users/gajus/Documents/dev/gajus/reactql
> cross-env RUNNER=static NODE_ENV=development ts-node index.ts

/Users/gajus/Documents/dev/gajus/reactql/node_modules/ts-node/src/index.ts:228
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/runner/app.ts(94,12): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("/Users/gajus/Documents/dev/gajus/reactql/node_modules/ora/index")' has no compatible call signatures.

    at createTSError (/Users/gajus/Documents/dev/gajus/reactql/node_modules/ts-node/src/index.ts:228:12)
    at getOutput (/Users/gajus/Documents/dev/gajus/reactql/node_modules/ts-node/src/index.ts:334:40)
    at Object.compile (/Users/gajus/Documents/dev/gajus/reactql/node_modules/ts-node/src/index.ts:367:11)
    at Module.m._compile (/Users/gajus/Documents/dev/gajus/reactql/node_modules/ts-node/src/index.ts:413:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/gajus/Documents/dev/gajus/reactql/node_modules/ts-node/src/index.ts:416: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 Module.require (internal/modules/cjs/loader.js:658:17)
jelleklaver commented 5 years ago

It is related to this issue: https://github.com/sindresorhus/ora/issues/102. I've now temporarily fixed it with forcing ora: 3.1.0 and @types/ora: 3.1.0 with npm.

athakral commented 5 years ago

this is because of https://github.com/sindresorhus/ora/issues/102. I suppose you can remove the @types/ora:3.1.0 and then fix the code a little bit. I would look into it when I get sometime

leebenson commented 5 years ago

@types/ora was removed in 4.4.2 just now, and ora was bumped in an earlier update, so hopefully this isn't an issue any more. Please re-open if it still surfaces.