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

Error when compiling docs #30

Closed
cdimitroulas opened this issue Feb 26, 2021 · 2 comments
Closed

Error when compiling docs #30

cdimitroulas opened this issue Feb 26, 2021 · 2 comments

Comments

@cdimitroulas
Copy link

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 🙏 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 😄

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
Copy link
Owner

gcanti commented Feb 26, 2021

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
Copy link
Author

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

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