SeleniumHQ/selenium · error · Error

Expected input and output file paths

Error message

Expected input and output file paths

What it means

wrap-get-attribute-as-global.js wraps the compiled getAttribute TypeScript atom as window.bot.dom.typescript.getAttribute. It requires two positional CLI args [inputPath, outputPath]; missing either throws immediately. Build-time helper invoked by Bazel; not user-facing.

Source

Thrown at javascript/atoms/typescript/wrap-get-attribute-as-global.js:27

//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

// Wraps the compiled getAttribute TypeScript output as a browser global so that
// test HTML pages can load it directly via <script> and access it as
// window.bot.dom.typescript.getAttribute.

const fs = require('node:fs');

const [inputPath, outputPath] = process.argv.slice(2);

if (!inputPath || !outputPath) {
  throw new Error('Expected input and output file paths');
}

const licenseHeader = `// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.`;

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Invoke as: node wrap-get-attribute-as-global.js <compiled-input.js> <wrapped-output.js>.
  2. Verify both $(location) expansions resolve to real files in the Bazel rule.
  3. Confirm the upstream compile produced the input.
  4. Run the Bazel target directly instead of the script.

Example fix

// before
node javascript/atoms/typescript/wrap-get-attribute-as-global.js get-attribute.compiled.js

// after
node javascript/atoms/typescript/wrap-get-attribute-as-global.js get-attribute.compiled.js get-attribute.global.js
Defensive patterns

Strategy: validation

Validate before calling

const [inputPath, outputPath] = process.argv.slice(2)
if (!inputPath || !outputPath) {
  console.error('Usage: wrap-get-attribute-as-global.js <input.js> <output.js>')
  process.exit(2)
}

Prevention

When it happens

Trigger: Invoking with fewer than two arguments. A Bazel rule that omits one $(location) substitution. Passing empty/undefined strings from a misconfigured macro.

Common situations: Editing the getAttribute atom BUILD file and dropping an argument. Manual debugging invocation. A target rename breaking location expansion.

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/8b38961f53aec94f. Report an issue: GitHub.