Skip to content

test: replace resolve.alias/customResolver with plugin resolveId #9598

Merged
sheremet-va merged 3 commits intovitest-dev:mainfrom
hi-ogawa:02-06-test_replace_resolve.alias_customresolver_with_plugin_resolveid_
Feb 6, 2026
Merged

test: replace resolve.alias/customResolver with plugin resolveId #9598
sheremet-va merged 3 commits intovitest-dev:mainfrom
hi-ogawa:02-06-test_replace_resolve.alias_customresolver_with_plugin_resolveid_

Conversation

@hi-ogawa
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa commented Feb 6, 2026

Description

As par vitejs/vite#21476, Vite 8 beta emits a following in stderr and CI is failing. https://github.com/vitest-dev/vitest/actions/runs/21734309219/job/62695879025?pr=9597#step:8:1671

`resolve.alias` contains an alias with `customResolver` option. This is deprecated and will be removed in Vite 9. Please use a custom plugin with a resolveId hook instead.

This PR replaced this.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@hi-ogawa hi-ogawa marked this pull request as ready for review February 6, 2026 04:36
@sheremet-va sheremet-va merged commit 1c4566e into vitest-dev:main Feb 6, 2026
13 of 16 checks passed
@hi-ogawa hi-ogawa deleted the 02-06-test_replace_resolve.alias_customresolver_with_plugin_resolveid_ branch February 6, 2026 09:34
@silvenon
Copy link
Copy Markdown
Contributor

The assets in CSS url() don't seem to ever visit resolveId, this is why I had been using resolve.alias.customResolver. Should I file a separate issue about this with a repro?

@sheremet-va
Copy link
Copy Markdown
Member

sheremet-va commented Feb 11, 2026

The assets in CSS url() don't seem to ever visit resolveId, this is why I had been using resolve.alias.customResolver. Should I file a separate issue about this with a repro?

You might need to set order: pre/enforce: pre in your plugin. If vite's plugin resolves the path, your plugin won't be called

@silvenon
Copy link
Copy Markdown
Contributor

I forgot to add that I already tried that already, both of those. But if you're sure I can do this, I'll try harder, trying with a minimal repro and working my way up to my actual setup to see when it stops working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants