Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular import causes strange cryptic error #3059

Open
arackaf opened this issue Dec 24, 2024 · 2 comments
Open

Circular import causes strange cryptic error #3059

arackaf opened this issue Dec 24, 2024 · 2 comments

Comments

@arackaf
Copy link
Contributor

arackaf commented Dec 24, 2024

Which project does this relate to?

Router

Describe the bug

This repo https://github.com/arackaf/tanstack-start-blog-dataloading/tree/special/start-bug-2 -- note the branch! special/start-bug-2
npm i

npm run dev
SECOND TERMINAL - npm run server

Go to the epics page. Edit an epic, and hit save.

Server function will error out. Reason is because of the queryClient import that's used in the client middleware. There's some incorrect bundling happening. Basically, if I move the queryClient export to its own file, it works just fine. So there seems to be some bundling shenanigans

Your Example Website or App

https://github.com/arackaf/tanstack-start-blog-dataloading/tree/special/start-bug-2

Steps to Reproduce the Bug or Issue

See above

Expected behavior

Should work without error

Screenshots or Videos

n/a

Platform

n/a

Additional context

No response

@arackaf
Copy link
Contributor Author

arackaf commented Dec 24, 2024

Repro is chopped down quite a bit - same instructions as above - use this url when running

http://localhost:3000/app/epics/1/edit

@tannerlinsley
Copy link
Collaborator

Looks like this was a circular dep issue that manifested itself in a weird way. We should consider adding https://www.npmjs.com/package/vite-plugin-circular-dependency to our dev deps when convenient.

@tannerlinsley tannerlinsley changed the title SSR bundle becomes invalid when importing queryClient Circular import causes strange cryptic error Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants