nuxt / nuxt/test-utils

Playwright tests fail with nitro preset azure

Open
#908 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug pending triage
Dominant language
TypeScript
Stars
437
Forks
120
Avg merge
22h 52m
Merged PRs (30d)
23

Description

Environment
  • Operating System: Windows_NT
  • Node Version: v18.17.1
  • Nuxt Version: 3.12.4
  • CLI Version: 3.12.0
  • Nitro Version: -
  • Package Manager: pnpm@9.6.0
  • Builder: -
  • User Config: future, compatibilityDate, devtools, nitro, extends, runtimeConfig, $test, modules, i18n, typescript, tailwindcss
  • Runtime Modules: @vueuse/nuxt@10.11.0, @nuxtjs/i18n@8.3.1, @nuxt/test-utils/module@3.13.1
  • Build Modules: -
Reproduction

https://codesandbox.io/p/devbox/modest-stonebraker-m9jvcl?file=%2Fplaywright.config.ts%3A13%2C1&workspaceId=7242797e-8630-4ea5-a2a8-c0ae92eb9b43

Describe the bug

When using the built-in utils from @nuxt/test-utils/playwright using the azure preset for nitro, running pnpm exec playwright test fails with:

Error: Cannot find module '/.nuxt/test/xxxx/output/server/index.mjs'

I have tried to point it to the location set when using azure through the nuxt configs in playwright.config.ts but the same suffix including server/index.mjs keeps being appended so no entry point is found.

Additional context

Overwriting the preset through nuxtConfig to use node-server in playwright.config.ts or using the utils directly from @playwright/test and replacing nuxt configs with a webServer running against azure CLI built preview works, but neither one of these are ideal solutions.

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the built-in utilities from @nuxt/test-utils/playwright and the playwright.config.ts reproduction, focusing on how the Azure Nitro preset resolves its server entry point. Compare this with the node-server preset and confirm that pnpm exec playwright test can run against Azure without appending server/index.mjs to the configured path.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, nuxt, playwright, typescript
Domain
cloud, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.