Skip to content

Failed to resolve import "bun:test" since v3.18.0 #1377

@AloisSeckar

Description

@AloisSeckar

Environment

  • Operating System: Windows_NT
  • Node Version: v22.15.1
  • Nuxt Version: 4.0.2
  • CLI Version: 3.27.0
  • Nitro Version: 2.12.4
  • Package Manager: pnpm@10.14.0
  • Builder: -
  • User Config: modules, compatibilityDate, eslint
  • Runtime Modules: @nuxt/eslint@1.7.1, @nuxt/test-utils/module@3.17.2
  • Build Modules: -

Reproduction

nuxt-spec project GitHub repo

Describe the bug

In my experimental Nuxt-testing related project I tried to bump all deps including @nuxt/test-utils today.

With v3.19.2 my basic e2e test (https://github.com/AloisSeckar/nuxt-spec/blob/main/test/nuxt-e2e.test.ts) started failing with:

Error: Failed to resolve import "bun:test" from "node_modules/.pnpm/@nuxt+test-utils@3.19.2_@vu_4cf1b4df40656f546fe6453b9bd863ee/node_modules/@nuxt/test-utils/dist/shared/test-utils.CT3RJOY3.mjs". Does the file exist?

I was browsing the release notes and noticed Bun support was added in v3.18.0.

I pinned my @nuxt/test-utils down to v3.17.2 and the test run smoothly.

Bumped up to v3.18.0 and the error was back:

Error: Failed to resolve import "bun:test" from "node_modules/.pnpm/@nuxt+test-utils@3.18.0_@ty_e83edee9a3fff740a26abcfe3b3f2831/node_modules/@nuxt/test-utils/dist/shared/test-utils.CT3RJOY3.mjs". Does the file exist?

I don't have Bun installed and I don't plan to install it anytime soon.

Did I just miss something? Do I need to do something specific in config to opt-out from it? The PR says it is "auto-detected if used". The Nuxt docs testing page doesn't mention any special treatment for Bun runner either.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions