gcanti / docs-ts

A zero-config documentation tool for my TypeScript projects
https://gcanti.github.io/docs-ts/
MIT License
100 stars 17 forks source link

Error when compiling docs #30

Closed cdimitroulas closed 3 years ago

cdimitroulas commented 3 years ago

Do you want to request a feature or report a bug? Don't think it's a bug, but it's unclear how to proceed with the usage of docs-ts for my project due to an error

What is the current behavior? I am unable to generate my docs due to the following error:

/home/cdimitroulas/code/cdimitroulas/smart-types-ts/node_modules/ts-node/src/index.ts:513
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
docs/examples/src-array-arrayWithLength.ts-function-mkArrayWithLength-0.ts(2,1): error TS2349: This expression is not callable.
  Type 'String' has no call signatures.

    at createTSError (/home/cdimitroulas/code/cdimitroulas/smart-types-ts/node_modules/ts-node/src/index.ts:513:12)
    at reportTSError (/home/cdimitroulas/code/cdimitroulas/smart-types-ts/node_modules/ts-node/src/index.ts:517:19)
    at getOutput (/home/cdimitroulas/code/cdimitroulas/smart-types-ts/node_modules/ts-node/src/index.ts:752:36)
    at Object.compile (/home/cdimitroulas/code/cdimitroulas/smart-types-ts/node_modules/ts-node/src/index.ts:968:32)
    at Module.m._compile (/home/cdimitroulas/code/cdimitroulas/smart-types-ts/node_modules/ts-node/src/index.ts:1056:42)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/home/cdimitroulas/code/cdimitroulas/smart-types-ts/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

My repository can be found at https://github.com/cdimitroulas/smart-types-ts - I would appreciate any guidance on what I have done wrong in setting up docs-ts :pray: I would like to also say thanks for all your hard-work on the fp-ts ecosystem - using fp-ts has really changed my way of programming for the better so I am very grateful!

What is the expected behavior? I was hoping to generate my first docs with docs-ts for my project :smile:

Which versions of docs-ts, and which browser and OS are affected by this issue? Did this work in previous versions of docs-ts? docs-ts@0.6.4

gcanti commented 3 years ago

Try to remove the code fence

 * @example
- * ```ts
 * import * as e from 'fp-ts/Either'
 * import { mkArrayWithLength } from 'smart-types'
 *
 * assert.deepStrictEqual(mkArrayWithLength(2, 10)([]), e.left("Length not between 2-10"))
 * assert.deepStrictEqual(mkArrayWithLength(2, 10)([1, 2, 3]), e.right([1, 2, 3]))
- * ```
cdimitroulas commented 3 years ago

Thanks, that got me a proper type error now! I should be able to figure it out from here :)