Skip to content

Splat route not work in dev mode for .js extensions #7523

Closed as duplicate

Description

@tonny008

Which project does this relate to?

Start

Describe the bug

Splat route not work in dev mode for .js extensions.

GET http://localhost:3000/xxai/oc-theme-preload.js
Accept: text/javascript

getting

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /xxai/oc-theme-preload.js</pre>
</body>
</html>

though if the accept is html. it is working fine

GET http://localhost:3000/xxai/oc-theme-preload.html
Accept: text/html

i suspect it is caused by nitro.

Complete minimal reproducer

https://stackblitz.com/edit/github-bn6ekw5n

Steps to Reproduce the Bug

  1. click test js get 404
  2. click test js implicit get 404
  3. click test html get 'hello'

Expected behavior

get 'hello' like test html

Screenshots or Videos

No response

Platform

  • Router / Start Version: [e.g. 1.121.0]
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

No response

Activity

  1. emgre commented on Jun 21, 2026

    @emgre

    I have a similar issue. I have a createFileRoute('/tts/{$file}') route that returns MP3 files. If and only if Nitro is enabled and the Accept is anything else but text/html (in my case, the <audio> elements asks for a audio/mpeg;[...]), then the request fails with a 404. The issue doesn't seem to happen in production builds.

    My only workaround for now is to disable Nitro during development.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions