-
Notifications
You must be signed in to change notification settings - Fork 12.8k
/// <reference types="xxx" /> from packages introduce collisions #12040
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
What I tried was to set What I also tried was to set |
why? is it a hard dependency on
how so? can you share more details.
This is a dependency of your other package. it needs to be satisfied to make it work. |
The package name is the popular react-apollo that brings graphql support and is built with typescript. What happens is that the package is built with "definitions". And definitions have the This is how one of the /// <reference types="react" />
/// <reference types="chai" />
/// <reference types="typed-graphql" />
/// <reference types="node" />
/// <reference types="es6-shim" />
import * as React from 'react';
.... I have not found any way of fighting back against this, only manually removing the "shim" reference in my node_modules, but as you can imagine this is not possible in CI. |
you should be able to override any declaration package using typeRoots. e..g create a new empty file |
@mhegazy thanks for your help! It took me awhile to realise how complete answer you gave me, as I have initially created my file as THANKS! 🌹 |
Glad this was resolved. but i want to emphasize that the main issue here is on the package side (caused by a compiler bug). Overriding declaration packages, though possible, is not the best possible solution. |
TypeScript Version: nightly (2.1.0-dev.201xxxxx)
The problem here is related to #11671
Package that I use requires "es6-shim" as following
/// <reference types="es6-shim" />
.This REQUIRES me to install @types/es6-shim otherwise I get an error
My project is ES6 based. As a result, after I install that dependency, I get following error during compilation:
No matter what I set to
types
property or totypeRoots
the error will never go away, unless I manually delete the 'PropertyKey' definition in the es6-shim.d.ts file. While this is ok in local, it PROHIBITS CI, as the project will never compile on CI serverWhat can I do in this case? Is there any way I can protect myself from these errors?
The text was updated successfully, but these errors were encountered: