Skip to content

fix(@wdio/browser-runner): port Vite and Stencil file URL imports to v10 (#15597) - #15763

Merged
christian-bromann merged 2 commits into
v10from
cb/port-vite-stencil-file-urls-15597-123f
Sep 29, 2026
Merged

christian-bromann merged 2 commits into
v10from
cb/port-vite-stencil-file-urls-15597-123f

Conversation

@christian-bromann

Copy link
Copy Markdown
Member

Proposed changes

Port of #15597 from main onto v10.

Absolute Windows paths are not valid ESM specifiers. A string viteConfig was imported from path.resolve(...), which throws ERR_UNSUPPORTED_ESM_URL_SCHEME on Windows. The import now uses pathToFileURL.

Stencil config import on v10 already used a file URL (from the Vitest 5 upgrade) but still swallowed every import error, so a broken stencil.config.ts was treated as "no config". A missing file still returns { config: {} }. An existing file is imported and its errors surface.

How you tested

  • Unit tests for the touched package(s)
  • Type definition tests (if the public API / command types changed)
  • Smoke or e2e (only if the testrunner, launcher, or a real browser path changed)

pnpm exec vitest --config vitest.config.ts --run packages/wdio-browser-runner/tests/vite/frameworks/stencil.test.ts packages/wdio-browser-runner/tests/vite/server.test.ts — 10 passed.

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Backport Request

  • This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

This is a forward-port onto v10, not a v8 backport. Source: #15597

Further comments

The Stencil file-URL import itself was already on v10. This port adds the missing-file check and the viteConfig file URL.

Reviewers: @webdriverio/project-committers

Open in Web Open in Cursor 

@christian-bromann
christian-bromann requested a review from a team as a code owner September 28, 2026 23:24
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: christian-bromann / name: Christian Bromann (6d24502)

…v10 (#15597)

Import a string viteConfig through a file URL so absolute Windows paths
are valid ESM specifiers. Keep the Stencil file URL import, and only
ignore a missing stencil.config.ts instead of swallowing errors from a
config that exists.
@pkg-pr-new

pkg-pr-new Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

create-wdio

npm i https://pkg.pr.new/webdriverio/webdriverio/create-wdio@15763

eslint-plugin-wdio

npm i https://pkg.pr.new/webdriverio/webdriverio/eslint-plugin-wdio@15763

wdio

npm i https://pkg.pr.new/webdriverio/webdriverio/wdio@15763

@wdio/allure-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/allure-reporter@15763

@wdio/appium-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/appium-service@15763

@wdio/browser-runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/browser-runner@15763

@wdio/cli

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/cli@15763

@wdio/concise-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/concise-reporter@15763

@wdio/config

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/config@15763

@wdio/cucumber-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/cucumber-framework@15763

@wdio/display-server

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/display-server@15763

@wdio/dot-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/dot-reporter@15763

@wdio/firefox-profile-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/firefox-profile-service@15763

@wdio/globals

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/globals@15763

@wdio/jasmine-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/jasmine-framework@15763

@wdio/json-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/json-reporter@15763

@wdio/junit-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/junit-reporter@15763

@wdio/lighthouse-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/lighthouse-service@15763

@wdio/local-runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/local-runner@15763

@wdio/logger

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/logger@15763

@wdio/mocha-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/mocha-framework@15763

@wdio/protocols

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/protocols@15763

@wdio/repl

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/repl@15763

@wdio/reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/reporter@15763

@wdio/runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/runner@15763

@wdio/sauce-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/sauce-service@15763

@wdio/session

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/session@15763

@wdio/shared-store-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/shared-store-service@15763

@wdio/smoke-test-cjs-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-cjs-service@15763

@wdio/smoke-test-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-reporter@15763

@wdio/smoke-test-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-service@15763

@wdio/spec-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/spec-reporter@15763

@wdio/static-server-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/static-server-service@15763

@wdio/sumologic-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/sumologic-reporter@15763

@wdio/testingbot-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/testingbot-service@15763

@wdio/types

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/types@15763

@wdio/utils

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/utils@15763

@wdio/webdriver-mock-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/webdriver-mock-service@15763

webdriver

npm i https://pkg.pr.new/webdriverio/webdriverio/webdriver@15763

webdriverio

npm i https://pkg.pr.new/webdriverio/webdriverio@15763

commit: e9fa533

@cursor
cursor Bot force-pushed the cb/port-vite-stencil-file-urls-15597-123f branch from c8e5f73 to 6d24502 Compare September 28, 2026 23:27
@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Fixes file URL handling in Vite and Stencil config imports.

The PR appears safe to merge; both previously reported gaps are addressed.

Fix All in CursorFindings

  1. P1 Broken configs still allow startup ▶
  2. P2 Broken config case untested ▶
Summary

The PR converts path-based Vite config imports to file URLs and makes errors from existing Stencil configs stop browser-runner initialization.

  • Adds tests for missing and broken Stencil configs and for initialization failure.

Reviews (2) · Last reviewed commit: "fix(@wdio/browser-runner): fail startup ..."

return { config: {} }
}

const config = await import(url.pathToFileURL(configPath).href)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Broken configs still allow startup When an existing stencil.config.ts fails to import, the error reaches BrowserRunner.initialize(), which only logs it and continues. The run can then start without the Stencil plugin or dependency optimizations, so the intended error-propagation fix remains incomplete.

Knowledge Base Used: Browser runner

Fix in Cursor Fix in Claude Code Fix in Codex

Comment on lines +79 to +85
test('optimizeForStencil without a Stencil config', async () => {
vi.mocked(hasFileByExtensions).mockResolvedValueOnce(undefined)
const opt = await optimizeForStencil('/foo/bar')
expect(opt.optimizeDeps).toEqual({
include: ['@wdio/browser-runner/stencil > @stencil/core/internal/testing/index.js']
})
expect(hasFileByExtensions).toHaveBeenLastCalledWith(path.join('/foo/bar', 'stencil.config.ts'), [])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Broken config case untested The new test covers a missing config, and the existing-config test uses a valid fixture. Neither checks that an existing config with an import error rejects. Without that assertion, the change could regress to silently accepting a broken config without a test failure.

Knowledge Base Used: Browser runner

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Cursor Fix in Claude Code Fix in Codex

…be imported

BrowserRunner.initialize logged the import error and continued, so a broken
stencil.config.ts still started the run without the Stencil plugin. The
error now rejects initialization, and the import failure is covered.
@webdriverio webdriverio deleted a comment from cursor Bot Sep 29, 2026
@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Sep 29, 2026
@christian-bromann
christian-bromann merged commit be6a183 into v10 Sep 29, 2026
37 of 38 checks passed
@christian-bromann
christian-bromann deleted the cb/port-vite-stencil-file-urls-15597-123f branch September 29, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant