Skip to content

Accessing via a non-localhost URL breaks vite dev server #4234

Closed

Description

@dunklesToast

Environment

node v24.10.0
nitro 3.0.260415-beta

Reproduction

https://github.com/dunklesToast/tanstack-nitro-vite-allowedhost

Describe the bug

it seems that if you use a allowedHost domain which just resolves to your machine / 127.0.0.1 the vite nitro
addon breaks the vite dev mode and returns the content of the splat page instead of the vite modules.

I suspect #4108 to be the source of this issue as it worked in 3.0.260311-beta and when patching nitro to log the isNitroRoute boolean, it will be true when accessing via localhost:3000 but false when using any other domain.

(more details can be found in the repro-repos README.md)

Additional context

Sorry for not using the provided template but Stackblitz was just stuck at "Cloning repo from GitHub" for 15min

Logs

Activity

  1. added
    pending triage
    on Apr 28, 2026
  2. dunklesToast commented on Apr 29, 2026

    @dunklesToast
    Author

    Thank you very much for the quick fix, @pi0 - I've already tested it via pnpm install https://pkg.pr.new/nitro@6016153 and then with the repro - works 🚀

  3. pi0 commented on Apr 29, 2026

    @pi0
    Member

    Awesome! Thanks for confirming the fix works.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions