-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Which project does this relate to?
Router
Describe the bug
When creating destructured exports like so:
export { a, b } = someFunction()It appears to work as expected. However, if you import a or b and attempt to use them, it causes an error:
[plugin:tanstack-router:code-splitter:compile-virtual-file] Property name expected type of string but got undefined
/home/projects/tanstack-router-htjxkgnt/src/routes/about.tsx
This issue is a reduced replication of a TanStack Form issue 1634. Since TanStack Form is no longer part of the reproducible example, I've closed that issue and opened one here. Please let me know if TanStack Form needs adjustments or the like.
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-htjxkgnt?file=vite.config.js
Steps to Reproduce the Bug or Issue
- Boot up the page
- Attempt to navigate to 'About'. You should see the error pop up.
- Go to
vite.config.tsand setautoCodeSplitting: false - You should now be able to navigate to 'About'
Expected behavior
As a user, I expect destructured exports to work regardless of nesting level with code splitting enabled.
Screenshots or Videos
No response
Platform
- Router / Start Version: react-router v1.129.8
- OS: Windows 11
- Browser: Librewolf (Firefox)
- Browser Version: 140.0.4-1
- Bundler: Vite
- Bundler Version: 6.3.5
Additional context
No response
CogitoBurrito, aboodman and jasperfue
Metadata
Metadata
Assignees
Labels
No labels