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] Path aliases not handled in plugins file #8555

Closed
chrisbreiding opened this issue Sep 11, 2020 · 2 comments · Fixed by #8557
Closed

[TypeScript] Path aliases not handled in plugins file #8555

chrisbreiding opened this issue Sep 11, 2020 · 2 comments · Fixed by #8557

Comments

@chrisbreiding
Copy link
Contributor

Current behavior:

Using a path alias in the plugins file results in a Cannot find module error.

Screen Shot 2020-09-11 at 10 03 53 AM

Desired behavior:

Path aliases should be supported when used in the plugins file.

Test code to reproduce

https://github.com/cypress-io/cypress-test-tiny/tree/alias-ts-paths

package.json

{
  "devDependencies": {
    "cypress": "5.1.0",
    "typescript": "4.0.2"
  }
}

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "baseUrl": "./src",
    "paths": {
      "@apps/*": ["*"]
    },
  },
  "include": ["cypress/**/*.ts"]
}

src/commons-e2e.ts

export const forward = true

cypress/plugins/index.ts

import { forward } from '@apps/commons-e2e'
console.log('forward is', forward)
export default function () {}

Versions

Cypress 4.6.0+

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Sep 11, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Sep 11, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 11, 2020

The code for this is done in cypress-io/cypress#8557, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 15, 2020

Released in 5.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant