Skip to content

Don't list @types packages as dependencies #600

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

Closed
nickzelei opened this issue Sep 27, 2017 · 4 comments
Closed

Don't list @types packages as dependencies #600

nickzelei opened this issue Sep 27, 2017 · 4 comments

Comments

@nickzelei
Copy link
Contributor

I tried installing typedoc and am suddenly getting a build error for a type definition that I don't even depend on, but typedoc does.

export function highlightBlock(block: Node) : 
node_modules/@types/highlight.js/index.d.ts(19,40): error TS2304: Cannot find name 'Node'.

All @types dependencies should be moved to devDependencies in package.json

@aciccarello
Copy link
Collaborator

Duplicate of #408 #335 #350 #384 #418 and #434

Please see those issues for discussion. TLDR: It isn't ideal but we need to have it that way.

When #579 is released that might fix your issue.

@nickzelei
Copy link
Contributor Author

nickzelei commented Sep 27, 2017

Thanks @aciccarello.

This doesn't really fix my issue though. What types am I missing that is causing this to fail?

VSCode is able to resolve the Node type to some interface in the TypeScript type definitions, but yet TS fails to build.

@aciccarello
Copy link
Collaborator

These errors usually happen because the type definition files are updated but don't follow semantic versioning so the version npm resolves is not compatible with the one used when TypeDoc was released. That's why #579 is pinning the versions.

As a workaround, you can use the --ignoreCompilerErrors option to get TypeDoc to build.

@nickzelei
Copy link
Contributor Author

Makes sense.

Thanks, will try that flag.

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