-
-
Notifications
You must be signed in to change notification settings - Fork 735
installing typedoc is forcing the use of 'dom' in tsconfig.json.compilerOptions.lib
#529
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
Comments
I've added a typedoc execution to the gulpfile of a library of mine just yesterday. The library does not depend on the DOM being present and can run in Node or the browser so it does not list Providing a MCVE/SSCCE/MWE, would help zero in on the problem you actually ran into. |
I'm encountering this issue too. @lddubeau Did you install |
Yeah, this is really unfortunate. Also unfortunately, the TypeScript team has been specific about not supporting multiple type definitions for browser vs node.js. This is the use-case I had with Typings that has since gone away with adopting NPM |
@blakeembrey Just found a solution actually. There's a compiler option called "types" which lets you be explicit about which type definitions to include, instead of including everything under |
@mnpenner That makes sense! It only works so long as TypeDoc never accidentally exports a type from one of these packages though. Right now the imports are elided from the |
@mnpenner I have |
Actually I can get my project compiling now, but I can't can't get typedoc working now. It's just spewing out dozens of random errors. I think I'm going to give up on it. |
Simpler solution: how about highlightjs just provide a stub Alternately, why do the |
Maintainer of the highlight.js definition here. Would this work for you? |
Oh, just re-read your comment+gist: you're proposing consumers of the highlight.js types should do that? If so, no - that doesn't work Since highlight.js exposes a |
This appears to be fixed now, I can generate documentation without dom included in the lib, please open a new issue if you are still having problems. |
I have a "pure" Node lib for which I wanted to use typedoc to generate documentation...
After installing it and running it I started getting this error:
node_modules/@types/highlight.js/index.d.ts(19,40): error TS2304: Cannot find name 'Node'.
After some googling I found this issue explaining that one of typedoc dependencies (highlight.js) requires 'dom' being in the list of
libs
for typescript compiler...Is there a way for me to use typedoc on a pure node library without having to resort to including 'dom' in typescript?
The text was updated successfully, but these errors were encountered: