Skip to content

Codesplitting stops working with files that reside outside the routesDirectory #4331

Closed
@jeroenpg

Description

@jeroenpg

Which project does this relate to?

Start

Describe the bug

This issue only happens with virtual routes (and potentially code based?), specifically when registering route that is NOT contained in the routesDirectory specified in app.config.ts.

I suppose we're not really supposed to load routes outside of the routesDirectory, although you would expect this not to matter with virtual routes.

Your Example Website or App

https://stackblitz.com/~/github.com/jeroenpg/tanstack-solid-start-load-all-modules

Steps to Reproduce the Bug or Issue

Open network tab, see that icons defined in bar.tsx are loaded on all routes, but not the ones in foo.tsx

Expected behavior

I either expect tanstack to warn me if I use routes that don't reside in my routesDirectory OR code splitting should keep working.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Brave
  • Version: n/a

Additional context

Discussed this in discord thread
https://discord.com/channels/719702312431386674/1379480149627768912

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