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

snapshot generation warnings on Windows #28739

Open
MikeMcC399 opened this issue Jan 17, 2024 · 2 comments
Open

snapshot generation warnings on Windows #28739

MikeMcC399 opened this issue Jan 17, 2024 · 2 comments
Labels
OS: windows process: contributing Related to contributing to the Cypress codebase

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Jan 17, 2024

Current behavior

Snapshot creation outputs hundreds of warnings when run on Windows, for example

> node_modules/ts-node/dist/index.js:247:38: warning: This call to "require" will not be bundled because the argument is not a string literal (surround with a try/catch to silence this warning)
    247 │             const transpilerFactory = require(transpilerPath)

Desired behavior

No warnings should be produced when snapshots are created on Windows.

Test code to reproduce

On Windows 11

  • Install Python 3.11 from the Microsoft Store.

  • Install Visual Studio Community version 2022, using the workload "Desktop development with C++" with its default selections (which includes Windows 11 SDK). Select (or use Visual Studio Installer > Modify) to add Optional component Windows 10 SDK (for example 10.0.20348.0).

git clone https://github.com/cypress-io/cypress

Use Node.js 18.15.0 18.17.1

If testing on existing clone then

git switch develop
git clean -xfd

using git Bash shell, execute

yarn

Subsequently snapshot generation can be repeated with

yarn build-v8-snapshot-dev

or

.github/workflows/update_v8_snapshot_cache.yml

Cypress Version

First reported on develop branch at tag 13.6.3
Continues to be reproducible on version 13.16.1

Node version

18.15.0 18.17.1

Yarn version

1.22.22

Operating System

Microsoft Windows 11 (and Windows Server 2022)

Debug Logs

yarn run v1.22.21
$ node --max-old-space-size=8192 tooling/v8-snapshot/scripts/setup-v8-snapshot-in-cypress.js --env=dev
2024-01-17T10:58:01.187Z cypress:snapgen:info Looking for bluebird duplicates ...
2024-01-17T10:58:05.102Z cypress:snapgen:info Found 11 bluebird duplicates, removing them
2024-01-17T10:58:05.243Z cypress:snapgen:info Done removing bluebird duplicates
2024-01-17T10:58:05.243Z cypress:snapgen:info Looking for lodash duplicates ...
2024-01-17T10:58:09.041Z cypress:snapgen:info Found 3 lodash duplicates, removing them
2024-01-17T10:58:09.178Z cypress:snapgen:info Done removing lodash duplicates
2024-01-17T10:58:09.180Z cypress:snapgen:info Creating snapshot metadata { nodeModulesOnly: true }
 > node_modules/ts-node/dist/index.js:247:38: warning: This call to "require" will not be bundled because the argument is not a string literal (surround with a try/catch to silence this warning)
    247 │             const transpilerFactory = require(transpilerPath)
        ╵                                       ~~~~~~~

 > node_modules/ts-node/dist/index.js:192:37: warning: "./transpilers/swc.js" should be marked as external for use with "require.resolve"
    192 │         transpiler = require.resolve('./transpilers/swc.js');~~~~~~~~~~~~~~~~~~~~~~

 > node_modules/ts-node/dist/configuration.js:237:56: warning: Indirect calls to "require" will not be bundled (surround with a try/catch to silence this warning)
    237 │ ...rn (0, util_1.attemptRequireWithV8CompileCache)(require, compiler);

and so on.

Other

Workflow runs on https://github.com/cypress-io/cypress/actions/workflows/update_v8_snapshot_cache.yml also show this issue.

@jennifer-shehane jennifer-shehane added OS: windows process: contributing Related to contributing to the Cypress codebase labels Jan 17, 2024
@jennifer-shehane
Copy link
Member

Yah, we don't run develop with Windows unless we're debugging something, so I'm not surprised.

@MikeMcC399
Copy link
Contributor Author

@jennifer-shehane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: windows process: contributing Related to contributing to the Cypress codebase
Projects
None yet
Development

No branches or pull requests

2 participants