Describe the bug#
I have a minimal example of my case.
It is a react app/lib, which has an import and usage of @tanstack/react-query. However when I build with it, I receive export 'default' (imported as 'App') was not found . When I comment out the usage and the import, everything works again.
I have tried with both webpack and rollup, the same issue persist.
Your minimal, reproducible example#
https://stackblitz.com/edit/vitejs-vite-id8z1w?file=src%2Findex.js,package.json,rollup.config.js,lib%2Fbundle.js&terminal=dev
Steps to reproduce#
- Build repo (in the example lib/bundle.js is already there)
- If you set this bundle in a test react application and try to import default component from the bundle you will receive an error: export 'default' (imported as 'App') was not found in './bundle' (module has no exports)
Expected behavior#
It should work without this error (like it works when I remove react-query).
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
- Runtime (webpack for example, when app which uses the bundle starts)
Tanstack Query adapter#
None
TanStack Query version#
5.51.3
TypeScript version#
No response
Additional context#
No response
sorry, I'm not going to look into this because it's very likely an issue with your bundler configuration. I looked at the bundled output and there is nothing that strikes out as odd between the two builds