Skip to content

Route generation corrupts example routes #4393

Closed
@campbellcole

Description

@campbellcole

Which project does this relate to?

Router

Describe the bug

Framework: SolidJS
Package Manager / Runtime: Deno

When route generation is enabled, route files that have content in them are still overwritten in some cases. When creating a project following the Solid Quick Start, as soon as deno task dev is run, the index.tsx and about.tsx routes are instantly corrupted.

The index route transforms from:

import { createLazyFileRoute } from '@tanstack/solid-router'

export const Route = createLazyFileRoute('/')({
  component: Index,
})

function Index() {
  return (
    <div class="p-2">
      <h3>Welcome Home!</h3>
    </div>
  )
}

to:

export const Route = createFileRoute({
  component: Index,
})

function Index() {
  return (
    <div class="p-2">
      <h3>Welcome Home!</h3>
    </div>
  )
}

Notably, the corrupted file imports nothing and completely breaks the demo.

Your Example Website or App

https://tanstack.com/router/latest/docs/framework/solid/quick-start

Steps to Reproduce the Bug or Issue

  1. deno run -RWE npm:create-vite-extra@latest
  2. Choose deno-solid
  3. cd vite-project && deno add npm:@tanstack/solid-router npm:@tanstack/router-plugin npm:@tanstack/solid-router-devtools
  4. Configure as described in the Solid Quick Start Guide
  5. deno task dev
  6. Observe about.tsx and index.tsx are now changed and broken

Expected behavior

I expect existing, valid files to be unchanged how __root.tsx is.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: N/A
  • Version: 1.121.3

Additional context

No response

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