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

tfx Error [ERR_REQUIRE_ESM]: require() of ES Module #491

Closed
maasha opened this issue Feb 3, 2025 · 3 comments
Closed

tfx Error [ERR_REQUIRE_ESM]: require() of ES Module #491

maasha opened this issue Feb 3, 2025 · 3 comments

Comments

@maasha
Copy link

maasha commented Feb 3, 2025

Our build pipeline started to fail.

The job:

  - job: BUILD_DEV_EXTENSION_JOB_1
    displayName: "Build Dev Extension Job 1"
    steps:
      - task: TfxInstaller@4
        inputs:
          version: "v0.x"
        displayName: "Install tfx"

The log:

2025-02-03T18:20:04.3270401Z ##[section]Starting: Install tfx
2025-02-03T18:20:04.3277999Z ==============================================================================
2025-02-03T18:20:04.3278293Z Task : Use Node CLI for Azure DevOps (tfx-cli)
2025-02-03T18:20:04.3278475Z Description : Installs the Node CLI for Azure DevOps (tfx-cli) on your agent.
2025-02-03T18:20:04.3278691Z Version : 4.4.357
2025-02-03T18:20:04.3278853Z Author : Microsoft Corporation
2025-02-03T18:20:04.3279301Z Help :
2025-02-03T18:20:04.3279449Z ==============================================================================
2025-02-03T18:20:19.4083652Z Caching tool: tfx 0.19.0 x64
2025-02-03T18:20:20.4737784Z Prepending PATH environment variable with directory: /opt/hostedtoolcache/tfx/0.19.0/x64/bin
2025-02-03T18:20:20.4742669Z [command]/opt/hostedtoolcache/tfx/0.19.0/x64/bin/tfx version --no-color
2025-02-03T18:20:20.8602599Z error: /opt/hostedtoolcache/tfx/0.19.0/x64/lib/node_modules/tfx-cli/_build/exec/version could not be fully loaded as a tfx command.
2025-02-03T18:20:20.8612599Z error: Error [ERR_REQUIRE_ESM]: require() of ES Module /opt/hostedtoolcache/tfx/0.19.0/x64/lib/node_modules/tfx-cli/node_modules/clipboardy/index.js from /opt/hostedtoolcache/tfx/0.19.0/x64/lib/node_modules/tfx-cli/_build/lib/tfcommand.js not supported.
2025-02-03T18:20:20.8613675Z error: Instead change the require of index.js in /opt/hostedtoolcache/tfx/0.19.0/x64/lib/node_modules/tfx-cli/_build/lib/tfcommand.js to a dynamic import() which is available in all CommonJS modules.
2025-02-03T18:20:20.8712026Z ##[error]The process '/opt/hostedtoolcache/tfx/0.19.0/x64/bin/tfx' failed with exit code 255
2025-02-03T18:20:20.8768539Z ##[section]Finishing: Install tfx

@manganellidev
Copy link

Same error here.

@jessehouwing
Copy link

Duplicate: #490

@jessehouwing
Copy link

Fixed by: #492

@maasha maasha closed this as completed Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants