GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ERROR: Could not resolve "util" in version 1.33.0 and up caused by unused import · Issue #1004 · browserstack/browserstack-cypress-cli

ERROR: Could not resolve "util" in version 1.33.0 and up caused by unused import #1004

New issue
Copy link
New issue
Copy link
Open
Open
ERROR: Could not resolve "util" in version 1.33.0 and up caused by unused import#1004
Copy link

Description

@JessePomerenk
JessePomerenk
opened on Sep 25, 2025
Issue body actions

Version 1.33 and up attempt to import a module "util" in the folder "browserstack-cypress-cli/testObervability/cypress/index.js"
The browserstack-cypress-cli module also does not include it in their dependencies, relying on another node module to have it as a dependency instead.

Looking through the entire "browserstack-cypress-cli/testObervability/cypress/index.js" file, it looks like "util" is only assigned to a constant and never used anywhere in the module.

Either add util as a dependency for browserstack-cypress-cli or remove "util" in this file.

The error I am seeing is this ( I have removed any personal information and replaced it with "██"):

"This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
- A missing file or dependency
- A syntax error in the file or one of its dependencies
Fix the error in your code and re-run your tests.
Oops...we found an error preparing this test file:
  > ██\somefile.feature

The error was :
Error: Build failed with 1 error:
node_modules/browserstack-cypress-cli/bin/testObservability/cypress/index.js:5:21: ERROR: Could not resolve "util"
    at failureErrorWithLog (██\node_modules\esbuild\lib\main.js:1467:15)
    at ██\node_modules\esbuild\lib\main.js:926:25
    at runOnEndCallbacks (██\node_modules\esbuild\lib\main.js:1307:45)
    at buildResponseToResult (██\node_modules\esbuild\lib\main.js:924:7)
    at ██\node_modules\esbuild\lib\main.js:951:16
    at responseCallbacks.<computed> (██\node_modules\esbuild\lib\main.js:603:9)
    at handleIncomingPacket ██\node_modules\esbuild\lib\main.js:658:12)
    at Socket.readFromStdout ██\node_modules\esbuild\lib\main.js:581:7)
    at Socket.emit (node:events:524:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)"

In my current setup we are running [email protected] which has removed util as a dependency which may have caused a breaking change in [email protected]+

https://docs.cypress.io/app/references/changelog#15-0-0
"In order to better align with best practices, @cypress/webpack-batteries-included-preprocessor no longer includes certain browser built-ins that were automatically provided by Webpack 4. The removed built-ins are assert, constants, crypto, domain, events, http, https, punycode, querystring, string_decoder, sys, timers, tty, url, util, vm, and zlib. However, we know that certain built-ins are popular, given that many users have files that are shared between their Cypress tests and node context. Because of this, @cypress/webpack-batteries-included-preprocessor will ship with built-in support for buffer, path, process, os, and stream. If there is a built-in that isn't supported by default and you need to add support, please refer to the Webpack resolve.fallback documentation and the @cypress/webpack-batteries-included-preprocessor README. Addresses #31039."

Activity

  1. JessePomerenk commented on Sep 25, 2025

    @JessePomerenk
    JessePomerenk
    on Sep 25, 2025
    Author
    More actions

    Created a PR for this issue.
    #1005

  2. JessePomerenk
    changed the title [-]Cypress version 15 no longer includes 'util' module[/-] [+]ERROR: Could not resolve "util" in version 1.33.0 and up caused by unused import[/+] on Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.