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

Typescript types issues #1627

Closed
alindesign opened this issue Apr 20, 2018 · 5 comments · May be fixed by schanne/cypress#1, schanne/cypress#4 or schanne/cypress#11
Closed

Typescript types issues #1627

alindesign opened this issue Apr 20, 2018 · 5 comments · May be fixed by schanne/cypress#1, schanne/cypress#4 or schanne/cypress#11
Assignees

Comments

@alindesign
Copy link
Contributor

Current behavior:

image

I have got some types error usign cypress with typescript, after some investigations and alot of tries to add these types on my tsconfig.json, nothing worked 😢 i have decided to change references from cypress/types/index.d.ts so:

// These references
/// <reference types="blob-util" />
/// <reference types="bluebird" />
/// <reference types="minimatch" />

// Transformed into
/// <reference path="./blob-util.d.ts" />
/// <reference path="./bluebird.d.ts" />
/// <reference path="./minimatch.d.ts" />

After this changes, everything worked normally 😞
There is the PR: #1622

Thanks in advance and sorry for my english :/

@bahmutov
Copy link
Contributor

Great, can you make a small repo reproducing the problem? Like a fork of https://github.com/cypress-io/cypress-test-tiny for example? I just want to see the problem myself

@bahmutov
Copy link
Contributor

also, @NicholasBoll what do you think?

@jennifer-shehane jennifer-shehane added topic: typescript stage: needs information Not enough info to reproduce the issue labels Apr 20, 2018
@NicholasBoll
Copy link
Contributor

The errors you're seeing makes sense - blob-util, bluebird and minimatch are the three dependencies that aren't namespaced (global definition). I can reproduce and your suggested solution fixes the issue. I'm pretty sure it worked at one point. Maybe the existing code used to work, but wasn't supposed to and a TypeScript change fixed that loophole.

// as it is right now
Cypress.Promise // any

// with the suggested change
Cypress.Promise // typeof Bluebird

I don't think I noticed when this started breaking because I've had skipLibCheck enabled (I've had issues with other namespaces colliding).

@jennifer-shehane jennifer-shehane added this to the 3.0.0 milestone Apr 23, 2018
@jennifer-shehane jennifer-shehane added stage: needs review The PR code is done & tested, needs review and removed stage: needs information Not enough info to reproduce the issue labels May 24, 2018
@brian-mann brian-mann modified the milestones: 3.0.0, 3.1.0 May 31, 2018
@NicholasBoll
Copy link
Contributor

#1622 has been merged, but didn't have a reference to this issue so it didn't automatically get closed. Can this issue be closed now?

@bahmutov
Copy link
Contributor

good catch @NicholasBoll closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment