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

Migrating to 5.0.0 : Can't resolve 'async_hooks' #8375

Closed
CodeTroopers opened this issue Aug 21, 2020 · 4 comments
Closed

Migrating to 5.0.0 : Can't resolve 'async_hooks' #8375

CodeTroopers opened this issue Aug 21, 2020 · 4 comments
Labels
type: regression A bug that didn't appear until a specific Cy version release v5.0.0 🐛 Issue present since 5.0.0

Comments

@CodeTroopers
Copy link

CodeTroopers commented Aug 21, 2020

I'm just migrating from 4.12.1 where all works to 5.0.0

Current behavior:

The test doesn't start and an error message is displayed

Error: Webpack Compilation Error
./node_modules/bluebird/js/release/promise.js
Module not found: Error: Can't resolve 'async_hooks' in '/e2e/node_modules/bluebird/js/release'
resolve 'async_hooks' in '/e2e/node_modules/bluebird/js/release'
Parsed request is a module
using description file: /e2e/node_modules/bluebird/package.json (relative path: ./js/release)
Field 'browser' doesn't contain a valid alias configuration
Looked for and couldn't find the file at the following paths:
[/e2e/node_modules/bluebird/js/release/node_modules]
[/e2e/node_modules/bluebird/js/node_modules]
[/e2e/node_modules/bluebird/node_modules]
[/e2e/node_modules/node_modules]
[/e2e/node_modules]
[/node_modules]
[/e2e/node_modules/async_hooks]
[/e2e/node_modules/async_hooks.js]
[/e2e/node_modules/async_hooks.json]
[/e2e/node_modules/async_hooks.jsx]
[/e2e/node_modules/async_hooks.coffee]
[/e2e/node_modules/async_hooks.ts]
[/e2e/node_modules/async_hooks.tsx]
@ ./node_modules/bluebird/js/release/promise.js 34:4-26
@ ./node_modules/bluebird/js/release/bluebird.js
@ ./node_modules/auth0/src/utils.js
@ ./node_modules/auth0/src/auth/index.js
@ ./node_modules/auth0/src/index.js
@ ./cypress/support/LoginCredentials.ts
@ ./cypress/support/commands.ts
@ ./cypress/support/index.ts

Test code to reproduce

We use auth0 api, if i comment this lines the test works:

import { ManagementClient } from 'auth0';

export class Auth0Service extends RequestService {
	private auth0!: ManagementClient;

	public constructor() {
		super();
		this.getToken();
	}

	private getToken() {
		this.auth0 = new ManagementClient(AUTH);
	}
}

Versions

Cypress: 5.0.0
OS: macOS Catalina 10.15.6
Chrome: 84.0.4147.135
Node: 12.16.2

@jennifer-shehane
Copy link
Member

I'm not able to recreate the issue as described. Please provide all code necessary to recreate the issue.

Code I ran

The code below runs fine without any webpack errors during cypress open.

cypress/support/index.ts (assumed this is where that code is since you didn't say

import { ManagementClient } from 'auth0';

export class Auth0Service extends RequestService {
  private auth0!: ManagementClient;

  public constructor() {
    super();
    this.getToken();
  }

  private getToken() {
    this.auth0 = new ManagementClient(AUTH);
  }
}

package.json

{
  "devDependencies": {
    "auth0": "^2.27.1",
    "cypress": "5.0.0",
    "typescript": "^4.0.2"
  }
}

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Aug 24, 2020
@CodeTroopers
Copy link
Author

I reproduce with this tsconfig.json in the cypress directory

{
	"compilerOptions": {
		"baseUrl": "../node_modules"
	},
	"include": ["**/*.ts"]
}

Not sure why I have this baseUrl option but it works with cypress 4.12.1

@jennifer-shehane
Copy link
Member

Yeah, I'm not exactly sure what I changed since I last ran this, but I am able to recreate this now. Maybe I was running in the older version accidentally.

cypress/support/index.ts (assumed this is where that code is since you didn't say

import { ManagementClient } from 'auth0';

export class Auth0Service extends RequestService {
  private auth0!: ManagementClient;

  public constructor() {
    super();
    this.getToken();
  }

  private getToken() {
    this.auth0 = new ManagementClient(AUTH);
  }
}

package.json

{
  "devDependencies": {
    "auth0": "^2.27.1",
    "cypress": "5.0.0",
    "typescript": "^4.0.2"
  }
}

Screen Shot 2020-08-26 at 5 47 31 PM

This specific error actually appears to be fixed in our next release already, but when running in our next release, there's this error thrown with the code above, which seems legitimate since this is not defined.

Screen Shot 2020-08-26 at 5 49 24 PM

Closing as this is pending release.

@jennifer-shehane jennifer-shehane added stage: pending release v5.0.0 🐛 Issue present since 5.0.0 type: regression A bug that didn't appear until a specific Cy version release and removed stage: needs information Not enough info to reproduce the issue labels Aug 26, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 1, 2020

Released in 5.1.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that didn't appear until a specific Cy version release v5.0.0 🐛 Issue present since 5.0.0
Projects
None yet
Development

No branches or pull requests

2 participants