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

Migration to v10.3.1 - Cypress configuration error Cannot find module 'cypress-webpack-preprocessor-v5' #22895

Closed
kevingorry opened this issue Jul 22, 2022 · 17 comments
Assignees
Labels
stage: awaiting response Potential fix was proposed; awaiting response

Comments

@kevingorry
Copy link

kevingorry commented Jul 22, 2022

Current behavior

We are on Cypress 8.5 and we decided to upgrade to v10.3.1. Currently 8.5 is working perfectly fine when doing a yarn cypress open

After installing v10.3.1 and running yarn cypress open I see this error instead of the migration screen.

Error
Your C:\Users\XX\icm-ui\apps\icm-web-cypress-ui\plugins\index.js file threw an error.

Please ensure your pluginsFile is valid and relaunch the migration tool to migrate to Cypress version 10.0.0.

Error: Cannot find module 'cypress-webpack-preprocessor-v5'

image

Desired behavior

Migration screen

Test code to reproduce

See details

Cypress Version

10.3.1

Other

cy-ts-preprocessor.js

const wp = require('cypress-webpack-preprocessor-v5');
const webpackOptions = require('../webpack.config');

module.exports = wp({ webpackOptions, watch: false, watchOptions: {} });

plugins/index.js

const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor');
const fs = require('fs');
const glob = require('glob');
const path = require('path');
const http = require('http');

module.exports = (on, config) => {
	require('@cypress/code-coverage/task')(on, config);
	on('file:preprocessor', cypressTypeScriptPreprocessor);
	on('task', {
		doesFileExist(filePath) {
			return fs.existsSync(filePath);
		},
		doesGlobMatchFiles(pattern, options) {
			return glob.sync(pattern, options).length > 0;
		},
		writeFile({ filePath, data }) {
			fs.writeFileSync(filePath, JSON.stringify(data));
			return null;
		},
		pathResolve(args) {
			return path.resolve(...args);
		},
		pathJoin(args) {
			return path.join(...args);
		},
		deleteFiles(pattern, options) {
			return glob(pattern, options, (_, files) => {
				for (const file of files) {
					fs.unlinkSync(file);
				}
			});
		},
		deleteFolder(folderName) {
			return new Promise((resolve, reject) => {
				fs.rmdir(folderName, { maxRetries: 10, recursive: true }, (err) => {
					if (err) {
						console.error(err);

						return reject(err);
					}

					resolve(null);
				});
			});
		},
	});
	on('after:run', () => {
		// stop nightly RESTAPI
		if (config.env.NIGHTLY) {
			const options = {
				hostname: 'localhost',
				port: 8085,
				path: '',
				method: 'POST',
			};
			const req = http.request(options);
			req.end();
		}
	});
	require('cypress-log-to-output').install(on, () => !!config.LOG_TO_STDOUT);
	return config;
};

@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 22, 2022
@kevingorry
Copy link
Author

@marktnoonan could it be because we don't have a cypress folder ? Ours is called icm-web-cypress-ui

@lmiller1990
Copy link
Contributor

Can you share your cypress.json? Most likely we are (incorrectly) assuming a cypress directory exists at some point.

Also, if you are opening Cypress 10.x for the first time, there is a migration UI that helps you change from cypress.json to cypress.config.js. It's generally pretty smooth. It doesn't actually run any specs, so you could potentially comment out the usage of the preprocessor, migrate to Cypress 10 with the UI, then put it back. Not really ideal, but just a suggestion to let you move forward.

Also, although you should be able to go from Cypress 8->10, it might be better to update to Cypress 9 first. The migration tool should work fine, but it's possible there are breaking changes from Cypress 8->9 that might be hard to debug if you skip an entire major version.

@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 Jul 26, 2022
@kevingorry
Copy link
Author

Hi @lmiller1990

As a test, I actually commented out the entire plugins/index.js and opened cypress. The migration screen showed up this time but instead of starting the migration with the step to rename specs to cy files, it started at the step to migrate the configs. It looks like it's not able to retrieve the spec files. I wonder if once again it's due to an assumption that the spec files are under cypress directory. It also skipped the renaming of the support file by the way. So only 1 step out of the 3 is working.

Do you have any suggestions to bypass these problems ? If not, how long will it take to address the issue ?

Here is the cypress.json file

{
	"baseUrl": "http://localhost:3000",
	"ignoreTestFiles": ["*.js", "*regenerated-test.ts"],
	"video": true,
	"downloadsFolder": "downloads",
	"fixturesFolder": "fixtures",
	"integrationFolder": "integration",
	"pluginsFile": "plugins/index.js",
	"screenshotsFolder": "screenshots",
	"supportFile": "support/index.ts",
	"videosFolder": "videos",
	"reporter": "junit",
	"reporterOptions": {
		"mochaFile": "results/test-output-[hash].xml",
		"toConsole": true
	},
	"projectId": "kc842k",
	"retries": {
		"runMode": 2,
		"openMode": 0
	},
	"watchForFileChanges": false
}

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jul 26, 2022
@lmiller1990
Copy link
Contributor

That's strange, we definitely have logic considering the integrationFolder set to something other than the default. Here is one of our test projects with a custom integrationFolder, for example.

Are you able to create a minimal reproduction?

Alternatively, can you try again, but run with DEBUG=cypress:* yarn cypress open and post the entire terminal output (it will be long). That will give us some more info on what is happening under the hood.

A minimal reproduction would be most ideal, but if that's difficult, debug logs are useful, too.

@kevingorry
Copy link
Author

kevingorry commented Jul 27, 2022

@lmiller1990 Unfortunately I haven't been successful in trying to create a minimal reproduction :(

Note : Our spec files naming convention does not use spec by the way, here is an example : TestName-test.ts

Here are the debugging logs :

$ DEBUG=cypress:* yarn cypress open
  cypress:cli:cli cli starts with arguments ["C:\\ProgramData\\nvm\\v12.16.1\\node.exe","C:\\Users\\KevinGorry\\icm-ui\\.yarn\\unplugged\\cypress-npm-10.3.1-b9950af2d1\\node_modules\\cypress\\bin\\cypress","open"] +0ms
  cypress:cli NODE_OPTIONS=--require C:\Users\KevinGorry\icm-ui\.pnp.js +0ms
  cypress:cli:cli program parsing arguments +2ms
  cypress:cli:cli opening Cypress +0ms
  cypress:cli parsed cli options {} +206ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +0ms
  cypress:cli checking if executable exists C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\Cypress.exe +2ms
  cypress:cli Binary is executable? : true +1ms
  cypress:cli binaryDir is  C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress +1ms
  cypress:cli Reading binary package.json from: C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\package.json +0ms
  cypress:cli Found binary version 10.3.1 installed in: C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress +1ms
  cypress:cli { verified: true } +2ms
  cypress:cli is Verified ? true +2ms
  cypress:cli opening from options {"project":"C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui"} +0ms
  cypress:cli command line arguments ["--project","C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui"] +0ms
  cypress:cli needs to start own Xvfb? false +0ms
  cypress:cli spawning, should retry on display problem? false +1ms
  cypress:cli spawn args [ '--', '--project', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--cwd', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--userNodePath', 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', '--userNodeVersion', '12.16.1' ] { detached: false, stdio: 'pipe', windowsHide: false } +4ms
  cypress:cli spawning Cypress with executable: C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\Cypress.exe +1ms
  cypress:cli piping process STDIN into child STDIN +8ms
  cypress:cli piping child STDOUT to process STDOUT +1ms
  cypress:cli piping child STDERR to process STDERR +0ms

[6888:0727/081411.617:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[6888:0727/081411.617:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
  cypress:ts registering ts-node on directory undefined +0ms
  cypress:ts Running without ts-node hook in environment "production" +61ms
  cypress:server:appdata path: C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\cache +0ms
  cypress:server:appdata path: C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\browsers +66ms
  cypress:server:cypress starting cypress with argv [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe', '--', '--project', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--cwd', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--userNodePath', 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', '--userNodeVersion', '12.16.1' ] +0ms
  cypress:server:args argv array: [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe', '--project', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--cwd', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--userNodePath', 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', '--userNodeVersion', '12.16.1' ] +0ms
  cypress:server:args parsed argv options { options: { _: [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe' ], project: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', cwd: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', userNodePath: 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', userNodeVersion: '12.16.1' } } +0ms
  cypress:server:args argv parsed: { _: [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe' ], project: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', cwd: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', userNodePath: 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', userNodeVersion: 
'12.16.1', invokedFromCli: true } +2ms
  cypress:server:util:proxy found proxy environment variables {} +0ms
  cypress:server:util:proxy HTTP_PROXY is falsy, disabling HTTP_PROXY +0ms
  cypress:server:util:proxy setting default NO_PROXY of `` +0ms
  cypress:server:util:proxy <-loopback> not found, adding localhost to NO_PROXY +0ms
  cypress:server:util:proxy normalized proxy environment variables { NO_PROXY: '127.0.0.1,::1,localhost' } +0ms
  cypress:server:args options { _: [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe' ], project: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', cwd: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', userNodePath: 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', userNodeVersion: '12.16.1', invokedFromCli: true, config: {} } +1ms
  cypress:server:args argv options: { _: [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe' ], project: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', cwd: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', userNodePath: 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', userNodeVersion: '12.16.1', invokedFromCli: true, config: {}, projectRoot: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui' } +0ms
  cypress:server:cypress from argv [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe', '--project', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--cwd', 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', '--userNodePath', 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', '--userNodeVersion', '12.16.1' ] got options { _: [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe' ], project: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', cwd: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', userNodePath: 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', userNodeVersion: '12.16.1', invokedFromCli: true, config: {}, projectRoot: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui' } +6ms
  cypress:server:appdata path: C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production +116ms
  cypress:server:cypress starting in mode interactive with options { _: [ 'C:\\Users\\KevinGorry\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\Cypress.exe' ], project: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', cwd: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', userNodePath: 'C:\\ProgramData\\nvm\\v12.16.1\\node.exe', userNodeVersion: '12.16.1', invokedFromCli: true, config: {}, projectRoot: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui' } +100ms
  cypress:server:cypress running Electron currently +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudLatestRunUpdateSpecData +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudProjectBySlug +1ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudProjectsBySlugs +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudSpecByPath +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudViewer +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.versions +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for CurrentProject.cloudProject +1ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for RemoteFetchableCloudProjectResult.data +2ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for RemoteFetchableCloudProjectSpecResult.data +0ms
  cypress:server:browsers:utils getBrowsers +0ms
  cypress:launcher:detect detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ], minSupportedVersion: 64 }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ], minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'beta', displayName: 'Chrome Beta', versionRegex: /Google Chrome (\S+) beta/m, binary: 'google-chrome-beta', minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary', minSupportedVersion: 64 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox', minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ], minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ], minSupportedVersion: 86 }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', 
versionRegex: /Microsoft Edge (\S+)/m, binary: [ 'edge', 'microsoft-edge' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge Canary (\S+)/m, binary: 'edge-canary', minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge Beta (\S+)/m, binary: 'edge-beta', minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge Dev (\S+)/m, binary: [ 'edge-dev', 'microsoft-edge-dev' ], minSupportedVersion: 79 } ] +0ms
  cypress:data-context:sources:GitDataSource config: { isRunMode: false, projectRoot: 'C:\\Users\\KevinGorry\\icm-ui\\apps\\icm-web-cypress-ui', onError: [Function (anonymous)], onBranchChange: [Function: onBranchChange], onGitInfoChange: [Function: onGitInfoChange] } +0ms
  cypress:scaffold-config:detect No typescript installed - using js +0ms
  cypress:server:util:editors get user editor +0ms
  cypress:server:saved_state making saved state from C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\server +0ms
  cypress:server:saved_state missing project path, looking for project here +0ms
  cypress:server:saved_state making saved state from C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\server +16ms
  cypress:server:saved_state for project path C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui +0ms
  cypress:server:saved_state state path for project C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui +2ms
  cypress:server:appdata path: C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\icm-web-cypress-ui-a57f18c945758f9c29a7acb2b926d29a\state.json +910ms  
  cypress:server:saved_state full state path C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\icm-web-cypress-ui-a57f18c945758f9c29a7acb2b926d29a\state.json +0ms
  cypress:server:saved_state making new state file around C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\icm-web-cypress-ui-a57f18c945758f9c29a7acb2b926d29a\state.json +0ms
  cypress:server:saved_state state path for global mode +7ms
  cypress:server:appdata path: C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\__global__\state.json +7ms
  cypress:server:saved_state full state path C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\__global__\state.json +0ms
  cypress:server:saved_state making new state file around C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\__global__\state.json +0ms
  cypress:launcher:windows got version string for chrome: { exePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', version: '103.0.5060.134' } +0ms      
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Google\\chrome-win32\\chrome.exe', exePaths: [], err: Error: Browser not installed: chromium at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +2ms
  cypress:data-context:sources:migration:codegen looking for pluginPath plugins/index.js in projectRoot C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui +0ms
  cypress:data-context:sources:migration:codegen fs.stats on C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui\plugins\index.js +0ms
  cypress:data-context:sources:migration:codegen found pluginsFile C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui\plugins\index.js +1ms
  cypress:data-context:MigrationActions found legacy pluginsFile at plugins/index.js +0ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files\\Google\\Chrome Beta\\Application\\chrome.exe', exePaths: [], err: Error: Browser not installed: chrome at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +15ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Google\\Chrome Beta\\Application\\chrome.exe', exePaths: 
[], err: Error: Browser not installed: chrome at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:107:20 { notInstalled: true } } +0ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Users\\KevinGorry\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe', exePaths: [], err: Error: Browser not installed: chrome at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +2ms
  cypress:launcher:windows got version string for firefox: { exePath: 'C:\\Program Files\\Mozilla Firefox\\firefox.exe', version: '103.0' } +2ms
  cypress:server:windows creating electron window with options { backgroundColor: 'white', width: 1294, height: 727, minWidth: 597, minHeight: 400, x: -4, y: 0, type: 'INDEX', devTools: false, trackState: { width: 'appWidth', height: 'appHeight', x: 'appX', y: 'appY', devTools: 'isAppDevToolsOpen' }, onBlur: [Function: onBlur], onFocus: [Function: onFocus], onClose: [Function: onClose], show: true, webPreferences: { contextIsolation: true, partition: null, webSecurity: false, nodeIntegration: false, backgroundThrottling: false }, url: 'http://localhost:50014/__launchpad/index.html', frame: true, contextMenu: false, recordFrameRate: null, onCrashed: [Function: onCrashed], onNewWindow: [Function: onNewWindow] } +0ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Users\\KevinGorry\\AppData\\Local\\Firefox Developer Edition\\firefox.exe', exePaths: [], err: Error: Browser not installed: firefox at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +129ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Firefox Developer Edition\\firefox.exe', exePaths: [], err: Error: Browser not installed: firefox at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:107:20 { notInstalled: true } } +0ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files\\Firefox Developer Edition\\firefox.exe', exePaths: [], err: Error: Browser not installed: firefox at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:107:20 { notInstalled: true } } +0ms
  cypress:lifecycle:child:run_require_async_child:24564 configFile: C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui\plugins\index.js +0ms
  cypress:lifecycle:child:run_require_async_child:24564 projectRoot: C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui +1ms
  cypress:data-context:MigrationActions legacyConfigIpc:ready +297ms
  cypress:lifecycle:child:run_require_async_child:24564 Loading file C:\Users\KevinGorry\icm-ui\apps\icm-web-cypress-ui\plugins\index.js +94ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Users\\KevinGorry\\AppData\\Local\\Firefox Nightly\\firefox.exe', exePaths: [], err: Error: Browser not installed: firefox at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +155ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Firefox Nightly\\firefox.exe', exePaths: [], err: Error: 
Browser not installed: firefox at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at 
tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:107:20 { notInstalled: true } } +0ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files\\Firefox Nightly\\firefox.exe', exePaths: [], err: Error: Browser not installed: firefox at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:107:20 { notInstalled: true } } +1ms
  cypress:launcher:windows got version string for edge: { exePath: 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe', version: '103.0.1264.71' } +2ms  
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Users\\KevinGorry\\AppData\\Local\\Microsoft\\Edge SxS\\Application\\msedge.exe', exePaths: [], err: Error: Browser not installed: edge at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at 
C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +1ms
  cypress:data-context:MigrationActions loadLegacyPlugins:error +9ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Microsoft\\Edge Beta\\Application\\msedge.exe', exePaths: [], err: Error: Browser not installed: edge at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +4ms
  cypress:launcher:windows error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe', exePaths: 
[], err: Error: Browser not installed: edge at notInstalledErr (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\errors.js:5:17) at tryNextExePath (C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:85:48) at C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:92:24 { notInstalled: true } } +1ms
  cypress:server:browsers:utils found browsers { browsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '103.0.5060.134', path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', minSupportedVersion: 64, majorVersion: 103 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', version: '103.0', path: 'C:\\Program Files\\Mozilla Firefox\\firefox.exe', minSupportedVersion: 86, majorVersion: 103 }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', version: '103.0.1264.71', path: 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe', minSupportedVersion: 79, majorVersion: 103 } ] } +346ms
  cypress:server:browsers:utils adding Electron browser { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '100.0.4896.160', path: '', majorVersion: 100, info: 'Electron is the default browser that comes with Cypress. This is the default browser that runs in headless mode. Selecting this browser is useful when debugging. The version number indicates the underlying Chromium version that Electron uses.' } +0ms
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────┬──────────────┬────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │   group   │ processCount │            pids            │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────┼──────────────┼────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │ 'cypress' │      1       │           '6888'           │     0      │       0        │  103.3   │    103.3     │    103.3    │
  cypress:server:util:process_profiler │    1    │  'other'  │      4       │ '3444, 20260, 5056, 19000' │     0      │       0        │  61.46   │    61.46     │    61.46    │
  cypress:server:util:process_profiler │    2    │  'TOTAL'  │      5       │            '-'             │     0      │       0        │  164.76  │    164.76    │   164.76    │
  cypress:server:util:process_profiler └─────────┴───────────┴──────────────┴────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +0ms
  cypress:server:util:editors user has the following editors: [ { id: 'code', binary: 'code', name: 'Visual Studio Code' } ] +739ms
  cypress:server:saved_state making saved state from C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\server +714ms
  cypress:server:saved_state missing project path, looking for project here +0ms
  cypress:data-context:sources:GitDataSource On current branch FIAT-297_upgrade_cypress +745ms
  cypress:server:saved_state state path for global mode +5ms
  cypress:server:appdata path: C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\__global__\state.json +719ms
  cypress:server:saved_state full state path C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\__global__\state.json +0ms
  cypress:server:util:editors saved preferred editor: undefined +6ms
  cypress:server:util:editors return available editors: [ { id: 'computer', name: 'File Explorer', binary: 'computer' }, { id: 'code', name: 'Visual Studio Code', binary: 'code' } ] +0ms
  cypress:server:saved_state making saved state from C:\Users\KevinGorry\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\packages\server +1ms
  cypress:server:saved_state missing project path, looking for project here +0ms
  cypress:server:saved_state state path for global mode +1ms
  cypress:server:appdata path: C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\__global__\state.json +2ms
  cypress:server:saved_state full state path C:\Users\KevinGorry\AppData\Roaming\Cypress\cy\production\projects\__global__\state.json +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Racing execution for Query.versions +937ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://registry.npmjs.org/cypress' } +0ms
  cypress:network:connect beginning getAddress { hostname: 'registry.npmjs.org', port: 80 } +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Racing execution for Query.cloudViewer +15ms
  cypress:graphql:remoteSchemaWrapped executing: {"operationName":"HeaderBar_HeaderBarQuery_cloudViewer","requestPolicy":"cache-first"} +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Racing Query.cloudViewer resolved immediately +8ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Query.versions did not resolve immediately +0ms
  cypress:network:connect got addresses { hostname: 'registry.npmjs.org', port: 80, addresses: [ { address: '104.16.17.35', family: 4 }, { address: '104.16.20.35', family: 4 }, { address: '104.16.21.35', family: 4 }, { address: '104.16.22.35', family: 4 }, { address: '104.16.19.35', family: 4 }, { address: '104.16.25.35', family: 4 }, { address: '104.16.24.35', family: 4 }, { address: '104.16.26.35', family: 4 }, { address: '104.16.23.35', family: 4 }, { address: '104.16.27.35', family: 4 }, { address: '104.16.18.35', family: 4 }, { address: '104.16.16.35', family: 4 } ] } +12ms
  cypress:network:agent got family { family: 4, href: 'https://registry.npmjs.org/cypress' } +49ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://download.cypress.io/desktop.json' } +19ms
  cypress:network:connect beginning getAddress { hostname: 'download.cypress.io', port: 80 } +55ms
  cypress:network:connect got addresses { hostname: 'download.cypress.io', port: 80, addresses: [ { address: '172.67.25.250', family: 4 }, { address: '104.22.10.239', family: 4 }, { address: '104.22.11.239', family: 4 } ] } +1ms
  cypress:network:agent got family { family: 4, href: 'https://download.cypress.io/desktop.json' } +23ms
  cypress:data-context:sources:VersionsDataSource retrieving latest version information with headers: { 'Content-Type': 'application/json', 'x-cypress-version': '10.3.1', 
'x-os-name': 'win32', 'x-arch': 'x64', 'x-initial-launch': 'true', 'x-machine-id': '70958dcf2ba937ea632167a7f57372bbaed8d9234a314647134e3ba3c39d2826' } +0ms
  cypress:data-context:sources:VersionsDataSource latest version information: { name: 'Cypress', version: '10.3.1', packages: { mac: { url: 'https://cdn.cypress.io/desktop/10.3.1/darwin-x64/cypress.zip' }, linux64: { url: 'https://cdn.cypress.io/desktop/10.3.1/linux-x64/cypress.zip' }, darwin: { url: 'https://cdn.cypress.io/desktop/10.3.1/darwin-x64/cypress.zip' }, linux: { url: 'https://cdn.cypress.io/desktop/10.3.1/linux-x64/cypress.zip' }, 'darwin-x64': { url: 'https://cdn.cypress.io/desktop/10.3.1/darwin-x64/cypress.zip' }, 'darwin-arm64': { url: 'https://cdn.cypress.io/desktop/10.3.1/darwin-arm64/cypress.zip' }, 'linux-x64': { url: 'https://cdn.cypress.io/desktop/10.3.1/linux-x64/cypress.zip' }, 'linux-arm64': { url: 'https://cdn.cypress.io/desktop/10.3.1/linux-arm64/cypress.zip' }, 'win32-x64': { url: 'https://cdn.cypress.io/desktop/10.3.1/win32-x64/cypress.zip' } } } +1ms
  cypress:data-context:sources:VersionsDataSource NPM release dates received { modified: '2022-07-19T16:51:56.330Z' } +183ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Racing Query.versions eventually resolved with { latest: { id: '10.3.1', version: '10.3.1', released: '2022-07-18T19:24:24.458Z' }, current: { id: '10.3.1', version: '10.3.1', released: '2022-07-18T19:24:24.458Z' } } HeaderBar_HeaderBarQuery +451ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Resolving versions for pushFragment with {"latest":{"id":"10.3.1","version":"10.3.1","released":"2022-07-18T19:24:24.458Z"},"current":{"id":"10.3.1","version":"10.3.1","released":"2022-07-18T19:24:24.458Z"}} +0ms
  cypress:data-context:sources:GraphQLDataSource pushFragment value {"data":{"versions":{"current":{"id":"10.3.1","version":"10.3.1","released":"2022-07-18T19:24:24.458Z","__typename":"Version"},"latest":{"id":"10.3.1","version":"10.3.1","released":"2022-07-18T19:24:24.458Z","__typename":"Version"},"__typename":"VersionData"}}} +0ms        
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────┬──────────────┬────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │   group   │ processCount │                    pids                    │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────┼──────────────┼────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │  'other'  │      6       │ '19000, 27716, 10196, 25668, 19072, 14944' │    0.37    │      0.18      │  233.38  │    147.42    │   233.38    │
  cypress:server:util:process_profiler │    1    │ 'cypress' │      1       │                   '6888'                   │    1.26    │      0.63      │  133.34  │    118.32    │   133.34    │
  cypress:server:util:process_profiler │    2    │  'TOTAL'  │      7       │                    '-'                     │    1.63    │      0.81      │  366.71  │    265.74    │   366.71    │
  cypress:server:util:process_profiler └─────────┴───────────┴──────────────┴────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s

@lmiller1990
Copy link
Contributor

lmiller1990 commented Jul 28, 2022

Nothing obviously wrong in debug logs. I do see pnp.js. Question... are you using Yarn 3? It seems we have some Yarn 3 issues: #22871. If so, perhaps that is the problem (it is not looking in the right place for the module, since Yarn 3 stores node_modules in a different fashion to other package managers).

@leschdom
Copy link
Contributor

Hi @kevingorry

Maybe changing from cypress-webpack-preprocessor-v5 (last publish ~2years ago - version 5.0.0-alpha.1 to the more "official" @cypress/webpack-preprocessor (last publish ~2months ago - version 5.12.0) might also do the trick?

I can imagine the package cypress-webpack-preprocessor-v5 was used as long as @cypress/webpack-preprocessor didn't support webpack 5 - but since v5.8+ it supports webpack 4 and webpack 5. The latest version also mentions some fix when switching from Cypress v9 to v10 (see https://github.com/cypress-io/cypress/blob/master/npm/webpack-preprocessor/CHANGELOG.md#cypresswebpack-preprocessor-v5120-2022-06-01)

So might be you only have to uninstall cypress-webpack-preprocessor-v5 and install @cypress/webpack-preprocessor and replace all cypress-webpack-preprocessor-v5 occurences with @cypress/webpack-preprocessor?

If that is the fix maybe the Cypress Migration Tool could check for this scenario too and support automatically?

@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 Jul 28, 2022
@kevingorry
Copy link
Author

Nothing obviously wrong in debug logs. I do see pnp.js. Question... are you using Yarn 3? It seems we have some Yarn 3 issues: #22871. If so, perhaps that is the problem (it is not looking in the right place for the module, since Yarn 3 stores node_modules in a different fashion to other package managers).

@lmiller1990 we are not using Yarn 3 yet but yarn-2.4.2.cjs

@mjhenkes mjhenkes assigned rockindahizzy and unassigned marktnoonan Aug 2, 2022
@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Aug 2, 2022
@kevingorry
Copy link
Author

kevingorry commented Aug 3, 2022

@leschdom same thing
image

@rockindahizzy anything else I should try ? I'm blocked

@leschdom
Copy link
Contributor

leschdom commented Aug 3, 2022

Thanks for your reply @kevingorry.

Might be a silly question but did you npm install -D @cypress/webpack-preprocessor? Not just search and replaced cypress-webpack-preprocessor-v5 with @cypress/webpack-preprocessor.

You may also check the if the packages are installed via:

npm ls cypress-webpack-preprocessor-v5 and npm ls @cypress/webpack-preprocessor - just to double check.

In my case it looks like:

npm ls @cypress/webpack-preprocessor
+-- @cypress/[email protected]
| `-- @cypress/[email protected] deduped
`-- @cypress/[email protected]

npm ls cypress-webpack-preprocessor-v5
`-- (empty)

@kevingorry
Copy link
Author

kevingorry commented Aug 3, 2022

Yes I installed it properly. I don't think it's specific to this package because if I comment out the line that make use of it in plugins/index.js it complains about the next line Error: Cannot find module 'glob'
image

For what it matters we are using :
Node v12.16.1
Yarn 2.4.2
Webpack 5.9.0

I feel like it's somewhat related to https://stackoverflow.com/questions/72799261/cannot-find-module-cypress-code-coverage-task

@lmiller1990
Copy link
Contributor

lmiller1990 commented Aug 4, 2022

Just to clarify - if you make a new project with Cypress 9.x run the examples tests, then update, do you have the same error? Is this problem related to your environment or your project specifically, I wonder?

Also, did you try with Yarn 1.x? That would be another thing to test - gradually change bits and pieces until you isolate the problem. Another question - is Cypress installed in your project, or globally?

Without a reproduction, I am not sure how much assistance I can be 😢

@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 5, 2022
@kevingorry
Copy link
Author

kevingorry commented Aug 9, 2022

@lmiller1990 so here is an update on both issues :

  1. Cannot find module XX

image

I think this is happening because Cypress is looking at a different node_modules folder. It seems that it looks for node_modules under icm-web-cypress-ui (where Cypress is installed) rather than .yarn/cache/xxx
How do I force it to look there ?

  1. Migration step to rename specs is skipped.

image

I found out that if I have the integration folder under icm-web-cypress-ui (where Cypress is installed) then Cypress migration tool is not able to see the spec files to migrate. Even with the cypress.json as such
"integrationFolder": "integration",

I have to add a cypress folder under icm-web-cypress-ui for this to work and I have to update the cypress.json
"integrationFolder": "cypress/integration",

Only then the migration tool can see the spec files. Why is that ?

@lmiller1990
Copy link
Contributor

lmiller1990 commented Aug 9, 2022

I think this is the same as:

#22871
#22747

Problem is we use require.resolve for many things which assumes the usual Node algorithm to look upwards for node_modules. Yarn 2+ does not do that. This will be fixed by supporting Yarn 2+ (like the other two issues suggest).

Unfortunately I don't think there is a user land fix for this, we need to add Yarn 2+ support in the main repo (not sure how to do this, someone needs to pick it up).

I will see if I can get something going soon - if you'd like to look into it, you are welcome too, I am not sure how trivial this fix is. Thanks for the useful debugging info so far - it's really useful.

@kevingorry
Copy link
Author

@lmiller1990 thank you for the explanation.

With regards to the second issue, any idea what is causing this ? I looked at this repo https://github.com/cypress-io/cypress/tree/develop/system-tests/projects/migration-e2e-custom-integration and the setup is indeed fairly similar but I'm not prompted to migrate the spec files...only if I create that cypress folder as mentioned above.

@lmiller1990
Copy link
Contributor

^ That is definitely strange. Any chance you can provide a minimal reproduction? I can't help but think it's a combination of Yarn 2+ with the alternative node_modules resolution or something to do with how the monorepo is set up.

It's also possible to do a manual migration - not sure if this will be useful, though, if the initial Yarn 2 issue is preventing you from moving forward.

Raising Yarn 2+ compat internal as a priority. In the meantime, I can try reproduce on my end.

@nagash77
Copy link
Contributor

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: awaiting response Potential fix was proposed; awaiting response
Projects
None yet
Development

No branches or pull requests

7 participants