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

ERR_LOADER_CHAIN_INCOMPLETE e2e in local #23393

Closed
oki-irawan opened this issue Aug 17, 2022 · 4 comments · Fixed by #23637
Closed

ERR_LOADER_CHAIN_INCOMPLETE e2e in local #23393

oki-irawan opened this issue Aug 17, 2022 · 4 comments · Fixed by #23637
Labels
topic: installation Issue during installation or downloading Cypress type: bug

Comments

@oki-irawan
Copy link

oki-irawan commented Aug 17, 2022

Current behavior

Hello there,

I was facing issue when installed cypress on my project, and it's just stuck like the picture showed bellow :

image

in addition to summary, I'm using vite v3.0.0 and with @vitejs/plugin-react

Stacktrace when run cypress open

Error [ERR_LOADER_CHAIN_INCOMPLETE]: "file:///Users/okiirawan/Library/Caches/Cypress/10.6.0/Cypress.app/Contents/Resources/app/node_modules/ts-node/esm/transpile-only.mjs 'resolve'" did not call the next hook in its chain and did not explicitly signal a short circuit. If this is intentional, include `shortCircuit: true` in the hook's return.
    at new NodeError (node:internal/errors:387:5)
    at ESMLoader.resolve (node:internal/modules/esm/loader:852:13)
    at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:431:7)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12) {
  code: 'ERR_LOADER_CHAIN_INCOMPLETE'
}

and here is the packages.json file in my project :

{
  "name": "my-react-app",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview",
    "lint": "eslint .",
    "lint:fix": "eslint --fix .",
    "prepare": "husky install",
    "test": "jest"
  },
  "dependencies": {
    "@emotion/react": "^11.10.0",
    "@emotion/styled": "^11.10.0",
    "@mui/material": "^5.9.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.18.10",
    "@testing-library/dom": "^8.16.1",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^14.4.2",
    "@types/react": "^18.0.15",
    "@types/react-dom": "^18.0.6",
    "@typescript-eslint/eslint-plugin": "^5.32.0",
    "@typescript-eslint/parser": "^5.32.0",
    "@vitejs/plugin-react": "^2.0.0",
    "cypress": "^10.6.0",
    "esbuild-jest": "^0.5.0",
    "eslint": "^7.32.0 || ^8.2.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-airbnb-typescript": "^17.0.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-import": "^2.25.3",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-react": "^7.28.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "husky": "^8.0.0",
    "identity-obj-proxy": "^3.0.0",
    "jest": "^28.1.3",
    "jest-environment-jsdom": "^28.1.3",
    "prettier": "^2.7.1",
    "typescript": "^4.6.4",
    "vite": "^3.0.0"
  }
}

Debug logs

No response

Cypress Version

10.6.0

Node version

v16.17.0

Package Manager

pnpm

Package Manager Version

7.9.0

Operating system

Mac

Operating System Version

12.5

Other

No response

@oki-irawan oki-irawan added the topic: installation Issue during installation or downloading Cypress label Aug 17, 2022
@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Aug 17, 2022
@mike-plummer
Copy link
Contributor

@oki-irawan Yikes! Thanks for reporting this issue.

It looks like you hit an issue related to an incompatibility with the version of ts-node we bundle and an API introduced in new versions of Node. In my local testing downgrading Node to version 16.16.0 seemed to do the trick, so that may be a workaround for you in the short term until we can get a newer version of ts-node bundled

@mike-plummer
Copy link
Contributor

@oki-irawan Another workaround would be to disable ESM handling in your project unless you're explictly depending on that. Removing the "type": "module" in your package.json will have Node default back to commonjs which won't hit this issue

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Aug 18, 2022
@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: awaiting response Potential fix was proposed; awaiting response stage: routed to e2e-core labels Aug 18, 2022
@baus
Copy link
Collaborator

baus commented Aug 26, 2022

@lmiller1990
Copy link
Contributor

lmiller1990 commented Sep 1, 2022

Many issues around this will be fixed in #23637. Thanks for the report, the whole module situation in the Node.js ecosystem is a complete mess now :|

I think you can work around it for now by using Node.js 16.16 (16.17 broke things).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: installation Issue during installation or downloading Cypress type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants