TanStackT
TanStack3mo ago
6 replies
full-green

/@handle route not giving a 404 on Netlify

@Manuel Schiller @Netlify (Partner)

What I would like

I want the following route pattern /@username

What I have done
Stack: Tanstack Start
"@netlify/vite-plugin-tanstack-start": "^1.1.12",
 "@tanstack/react-query": "^5.87.4",
"@tanstack/react-router": "^1.135.2",
"@tanstack/react-start": "^1.135.2",
"@tanstack/zod-adapter": "^1.135.2",


vite.config.ts
...
export default defineConfig({
  server: {
    port: 3000,
  },
  plugins: [
    tsConfigPaths(),
    tanstackStart(),
    netlify(),
    viteReact(),
    tailwindcss(),
  ],
})

Folder/file structure
- src
-- routes
--- @{$handle}
---- route.tsx
     export const Route = createFileRoute('/@{$handle}')
---- index.tsx


netlify.toml file
[build]
  command = "vite build"
  publish = "dist/client"

What is the problem
/@handle this is not working on Netlify however works in local development

I am getting a 404 error on netlify
Was this page helpful?